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

Assignment Help:

 

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.

 


Related Discussions:- Describe the life cycle methods of a jsp?

Retrieving data from Excel file , how to retrieve data from Excel file, and...

how to retrieve data from Excel file, and display that data in table on jsp page?

Use of weblogic platform in project, Use of WebLogic Platform in Project: ...

Use of WebLogic Platform in Project: Technologies Tools: Weblogic 8.1, Solaris 9, MQ Series 6.0, iplanet 6.1, Mercury Test Director. Project Overview: Wellington Manag

Cryptoarithmatic, Create problem that solves cryptoarithmatic problem that ...

Create problem that solves cryptoarithmatic problem that uses from user using java

What is color in awt, What is Color in AWT? Color is a class in the AWT...

What is Color in AWT? Color is a class in the AWT. Individual colors such as red or mauve are examples of this class, java.awt.Color. Be sure to import it if you want to use ot

Java, Ask question Write an inheritance hierarchy for classes Quadrilateral...

Ask question Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Create

Explain multi dimentional arrays in java, Explain multi dimentional arrays ...

Explain multi dimentional arrays in java? So far all these arrays have been one-dimensional. That is, a single number could locate any value in the array. Therefore sometimes d

Write javascript code to convert the number, Write JavaScript code to conve...

Write JavaScript code to convert the number 236.2363611111556 into currency format and JavaScript statement to show output? Var input_amt = 236.2363611111556 ; mid_data = input

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd