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
Explain primitive data types in java? Java's primitive data types are extremely similar to those of C. They involve boolean, byte, short, long, int, float, double, and char. Th

Advice is the execution of an aspect. It is something like telling your application of a new behavior. Generally, and advice is inserted into an application at joinpoints

UnsupportedClassVersionError

A:Java is a computer language. There are some of the reasons which describe:   1. Built-in support for multi-threading, memory management (automatic garbage collection), and

Add WordPress color picker to plug-in text field Project Description: I have a simple plug-in that needs the built-in Word Press color picker added to one of the text input f


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

Overview Demonstrate your knowledge of JavaScript and ColdFusion by implementing the following functionality: Contact form • The following validation error message shou

#question.Write a program that computes the edit distance (also called the Levenshtein distance, for its creator Vladimir Levenshtein) between two words. The edit distance between

Project Description: We need to develop software that has a database of players with the ability to delete and add players at will, once captured there can be a draw to set them