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
Write a JavaScript program to prompt the user for the radius of a sphere and call function sphereVolume to calculate and display the volume of the sphere in the status bar.

Implicit objects are formed by the web container and have information related to a particular request, page, or application. They are request, response, pageContext, session, appli

Why should we, as computing professionals, be interested within studying the social implications of our creations? This is important Because of remaining the track of money wis

I want cyclos mobile banking USSD and IVR module Project Description: We already have a Cyclos mobile banking project deployed on our server with SMS banking module. The s

Give the example of Using a class from the class library ? You use the java.net.URL class only like you'd use any other class along with these methods in which happens to be n

How much CPU time does an applet get? One of the few legitimate concerns about hostile applets is excessive use of CPU time. It is possible on a non-preemptively multitasking s

How do I write a program a bout Rotor cipher?

1. The purpose of this problem is to practice using ArrayLists.Write a Java client file containing a mainmethod plus other methods as needed to solve the following problem (no clas

Your task is to design a scheduler for the Sheridan Rail Corporation which keeps track of all daily scheduled trips for the railway.  Users can add new trips as well as perform sea

You are required to implement a Java application that allows a user to create, read, update and delete data in a table in a MySQL database. Your program must use a Java class that