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?

Cadence design systems, Cadence Design Systems:   Role Working ...

Cadence Design Systems:   Role Working on tickets including debugging of unix based applications Installations of unix based tools/utlity Installation

Use javascript create some basic client-side validation, The last exercise ...

The last exercise of each assignment will be continuous from assignment to assignment and will have the goal of building an e-store website by the end of the course. Date & Tim

Android app for evaluating of distance, Android app for evaluating of dista...

Android app for evaluating of distance Project Description: The request is to prepare an app for Android. The application needs to run on tablet (7 "or larger) and the layout

What is prototype, Prototype is having multiple instances or having clone.

Prototype is having multiple instances or having clone.

Multiple choices output and codes, codes and output on how to make multiple...

codes and output on how to make multiple choices quiz

Java and Arrays, AskWrite an application that uses an Array to store 10mess...

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

Photo upload feature to android app with google app engine, Include Photo U...

Include Photo Upload feature to Android App with Google App Engine Project Description: I have one small Android App skeleton that requires some features added to and backed

Java web services, #quThis project is based on the teams example of chapter...

#quThis project is based on the teams example of chapter 1. Instead of teams, you will consider employees working in a department in a company. (Departments and employees are ana

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