What are the basic components of jsp?, JAVA Programming

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.

 

Posted Date: 7/25/2012 4:02:47 AM | Location : United States







Related Discussions:- What are the basic components of jsp?, Assignment Help, Ask Question on What are the basic components of jsp?, Get Answer, Expert's Help, What are the basic components of jsp? Discussions

Write discussion on What are the basic components of jsp?
Your posts are moderated
Related Questions
Why we Avoiding Short Circuits ? If you need all of your boolean expressions evaluated regardless of the truth value of each, then you can use & and | instead of && and ||. The

What 'System.out.println()' signifies? 'System' is a predefined class. System class gives access to the system. 'out' is the output stream. 'println' is printin

do you have example of a simple midlet game ?

What is spreadsheet? List any two jobs that it can do? A spreadsheet is a grid which organizes data within columns and rows. Spreadsheets form it simple to display information,

JNLP/ Java Application - GUI and Backend Projects Project Description: I am looking for assist in making changes to a complex java application. System launches from web pa

I just finished a small tutorial on JSP and servlet now I was looking for some assignments so that I can try my hands on

search a file with specific extension


In this assignment you work on a set of tasks with the classes Currency, Money and Bank. Money and Currency You have been given a template for the Currency and Money classes (Lab1.

#question.Write a program to find the area under the curve y = f(x) in java.