JSP page life cycle

JSP page life cycle

Answer
JSP page life cycle includes 3 methods

jspInit() method
This initializes the JSP.

_jspService()
Each time a request comes to the JSP, _jspService() method is invoked, the request is processed and response is generated.

jspDestroy()
This method is used for clean process and is called when JSP is destroyed by the server.

JSP page life cycle

A request from a browser is served as servlet in JSP. In this way the lifecycle and certain capabilities of JSP are determined by a servlet.

At the time of mapping a request to a JSP, that request is handled by a special servlet which checks the JSP’s servlet is older than the JSP. If so, the JSP is translated into a servlet class and compiles. The build process of a web application is done automatically, by using JSP over servlet.
JSP directives - What are JSP directives?
JSP directives are used to set global values like class declaration, content type etc have scope for entire JSP file. ..
JSP implicit objects - What are different implicit objects of JSP?
JSP implicit objects - There different implicit objects of JSP are pageContext,pageScope,requestScope...
What are scopes an object can have in JSP page?
JSP object - An object can have following scopes in a JSP page: Page Scope,Request Scope, Session Scope...
Post your comment