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
ANDROID APK for 3G dongles support Project Description: We want someone who will modify this Android app or code a similar one. The App function is to let Android tablet P

Ask question #MBookshelves A library decides buy bookshelves to store its books and they need to determine the bookshelves’ heights and widths in order to minimize storage costs. T

Custom Website Technical Specification Document A Solution provider / System Architect to interpret and speak with me and build business functional needs and a set of research d

The method should printout line numbers from 1 to howmany in the previous format -ONLY WHEN is divisble by 3 but is should not oupt more then 3 numbers on the line. input 1 outpu

A specialized subclass of ActionForm that permits the creation of form beans with dynamic sets of properties (configured in configuration file), without requiring the developer to

Write a Java application to simulate a bank system. In the system, customers can open new bank accounts with the bank, and register/use an online account to manage their bank accou


Task 1- Design the complete user interface of the simulation. Task 2 -Design the record structures of the text files that are required to drive the working simulation. Populate

Explain function arguments with the help of an example? Arguments on a function are comma separated list of data enclosed within braces. It describes interface among the web pa

Explain the concept of Multi-Threaded- JAVA Java has a concept of concurrency wired right in to the language itself. This works out more cleanly than languages where concur