What are the basic components of jsp?, JAVA Programming

Assignment Help:

There are two different types of data in a JSP page.

1. Static part which occurs copied directly to the response by the JSP Engine.

2. Dynamic part, which have anything that may be compiled and translated by the JSP Engine.

There are three basic types of dynamic components. (TIP: remember SAD as an abbreviation for Scripting, Directive elements, and Action).

Declaration component: is the embedded Java declaration statement, which gives inserted at the Servlet class level.

<%! Calendar c = Calendar.getInstance(); %>

 Can you define a method within your JSP page?

You can define methods within your JSP pages as declarations, and your methods may be called from within your other methods you define, scriptlets or expression elements. Those declared functions do not have direct access to the JSP implicit objects like response, request, session etc but you may pass them to your functions you declare as parameters.

Expression Element: is the embedded Java expression, which gets solved by the service method.

<%= new Date() %>

Scriptlet Element: are the embedded Java statements, which get performed as part of the service function.

<%

            String username = null;

username = request.getParameter("firstName"); //"request" is a JSP implicit object

%>

Action components: A JSP element that gives information for execution phase.

 


Related Discussions:- What are the basic components of jsp?

Describe the java.lang package, Describe the java.lang package ? Each p...

Describe the java.lang package ? Each package describes a number of classes, exceptions, interfaces, and errors. For instance, in Java 1.1 the java.lang package holds these:

What is an objects lock, What is an object's lock and which objects have lo...

What is an object's lock and which objects have locks? An object's lock is a mechanism that is used by multiple threads to get synchronized access to the object. A thread may i

Package diagrams , To simplify complex class diagrams you may group classes...

To simplify complex class diagrams you may group classes into packages.

A talent agency program , class Writer extends Client {    // additional m...

class Writer extends Client {    // additional members    private boolean technical = false;    private boolean government = false;    private boolean international = false;    pri

Moving blobs, Don''t know how to write this...can anyone help me?

Don''t know how to write this...can anyone help me?

Explain the term- comparing strings, Explain the term- Comparing Strings ...

Explain the term- Comparing Strings For comparing Strings never use == operator, use equals method of String class. - == operator compares addresses (shallow comparison) whi

What will be the output of given program, What will be the output of this p...

What will be the output of this programme? Write comments where you find "//" symbol in the following code? function doSomething() { // 1 setTimeout('doSomething()',10000

N-th padovan string p(n), write a program that count the number of occurenc...

write a program that count the number of occurences of string in the n-th padovan string p(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college progr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd