This is a discussion on lifecycle methods os JSP within the Java Server Pages (JSP) forums, part of the Web Development category; can anyone tell me What are the life-cycle methods of JSP?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hi, The generated servlet class for a JSP page implements the HttpJspPage interface of the javax.servlet.jsp package. Hte HttpJspPage interface extends the JspPage interface which inturn extends the Servlet interface of the javax.servlet package. the generated servlet class thus implements all the methods of the these three interfaces. The JspPage interface declares only two mehtods - jspInit() and jspDestroy() that must be implemented by all JSP pages regardless of the client-server protocol. However the JSP specification has provided the HttpJspPage interfaec specifically for the JSp pages serving HTTP requests. This interface declares one method _jspService(). The jspInit()- The container calls the jspInit() to initialize te servlet instance.It is called before any other method, and is called only once for a servlet instance. The _jspservice()- The container calls the _jspservice() for each request, passing it the request and the response objects. The jspDestroy()- The container calls this when it decides take the instance out of service. It is the last method called n the servlet instance. |
| |||
| JSP Lifecycle: Translation Phase: JSP Page will be converted to Servlet. Compilation Phase: The resulting servlet is compiled. Instantiate and loading Phase: Instance will be created for the servlet ands it will be loaded to memory. Call jspinit():Perform Initialization process. Call _jspService(): this will be called upon each request. Call jspDestroy(): the instance will be destroyed when not needed any more. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Different record methods | Shanthi | Testing Tools | 1 | 08-27-2007 05:50 AM |
| Web service methods? | devarajan.v | XML and SOAP | 1 | 08-11-2007 01:33 AM |
| When should I use constructors, and when should I use other methods? | prasath | Java Programming | 1 | 07-20-2007 07:42 AM |
| What is a Windows Service and how does its lifecycle differ from a “standard” EXE? | vadivelanvaidyanathan | ASP and ASP.NET Programming | 1 | 07-16-2007 01:31 AM |
| “magic” Methods | ragavraj | PHP Programming | 0 | 03-17-2007 05:54 AM |