Describe the life cycle methods of a jsp? , JAVA Programming


1. Pre-translated: Before the JSP file has been compiled and translated into the Servlet.

2. Translated: The JSP file has been compiled and translated as a Servlet.

3. Initialized: Prior to handling the requests in the service function the container calls the jspInit() to initialize the Servlet. Invoked only once per Servlet instance.

4. Servicing: Services the client requests. Container invokes the _jspService()  function for each request.

5. Out of service: The Servlet resource is out of service. The container invokes the jspDestroy() function.

Could you have your JSP-generated servlet subclass your own servlet instead of the default HttpServlet?

Your JSP started servlet may extend your own servlet with the directive:

<%@ page extends="com.CRMServlet"%>

But, you have to be very careful when having your JSP pages added your own servlet class.  By doing so you can lose any advanced optimization that can be given by your JSP engine.  If you do have a compelling problem to do so then your own superclass servlet has to fill the aspect with the JSP engine by:

1.  Providing the HttpJspPage interface for JspPage interface or HTTP protocol. If you do not then you will have to prepare that all your super-class servlet functions are defined as final.

2.  Implementing your super-class servlet functions as given:

  • The service() method has to call the _jspService() function.
  • The init() method has to call the jspInit() function.
  • The destroy() method has call jspDestroy() function.

If the above conditions are not present, then a translation error may be given by your JSP engine.


Posted Date: 7/25/2012 4:01:48 AM | Location : United States

Related Discussions:- Describe the life cycle methods of a jsp? , Assignment Help, Ask Question on Describe the life cycle methods of a jsp? , Get Answer, Expert's Help, Describe the life cycle methods of a jsp? Discussions

Write discussion on Describe the life cycle methods of a jsp?
Your posts are moderated
Related Questions
Prompt the user for an int between an upper and lower boundary. Reuse the validateInput() method from project 2 to validate if the input is in bounds. If it is not, print an error

Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field

An execution of the JMS interface for a Message Oriented Middleware (MOM). Providers are executed as either a Java JMS execution or an adapter to a non-Java MOM.

Defiine the term Object ? Object is a named collection of properties (data, state) & techniques (instructions, behavior). Mainly Objects are key to understanding object-oriente

what are the advantages of packages and interface? why we use them? and what is the way of using packages and interfaces complete description with examples?

using polymorphism to write a program to display digital clock

Overall Requirements Every phone number is broken up into sections as shown below: Country Code Area Code Prefix Line Number 1 919 882 5000 Write a program to separate out a ph

I need Java Web Applications Development Project Description: MySQL databases, Oracle. SVN, GIT team collaborations. Skills required: Java, SQL, Software Architectur

Explain the term Event Handler? An event handler is a command that calls a function while an event happens, like as the user clicking a button.

please help please help please help please help please help please helpplease help please help