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
Padovan String

In this assignment you will create a graphical reverse polish notation calculator using a stack data structure.  A reverse polish notation calculator allows you to perform chain ca

The roster lets you keep track of the availability ("presence") of other users. A roster also allows you to organize users into groups such as "Friends" and "Co-workers". Other IM

AskWrite an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a message could be “I love

Write responsibilities of the followings 1. Developer a) Module level design. b) Coding c) Unit testing 2. Executive Team a) Responsible for the day to day operations. b) A

how can i create an E-exam application on netbeans

What is object oriented programming language? In classic, procedural programming you try to form the real world problem you're attempting to solve fit a few, predetermined data

WebSphere - Weblogic and Apache: Building/Installation  and maintenance of Solaris and Linux machines. Exposure to Sun Hardware : Sunfire v880,v890.V440,X4600

What is the difference between inner class and nested class? When a class is explained within a scope od another class, then it becomes inner class. If the access modifier o

program to find the frequency of a digit in a number