Google News
logo
JSP - Interview Questions
What is the jsp life cycle and Explain.
Any JSP file goes through 7 stages and that is called life cycle phases :
 
* Translation: JSP first goes to the Container, where it is parsed to generate servlet code. If the servlet class is older than JSP, then the Container parses it again. Else it is skipped.

* Compilation: After translation, Container compiles JSP source code to create a class file.

* Loading: The Container loads the compiled class into memory.

* Instantiation: Container invokes constructor that has zero arguments to instantiate it. 

* Initialization: Container Calls the jspInit() method to initialize the servlet instance. After this, JSP can handle the client request.

* Request Processing: After initialization, new threads are created with the _jspService() method. This method will have request and response object parameters. Each thread will process client requests the same as the servlet.

* Destroy: After the processing is over, the JSP class is unloaded from memory using the jspDestroy() method.
Advertisement