The JSP Life Cycle
These are the life cycle phases of a JSP (hello.jsp, for instance):
- Translate
hello.jsp into hello$jsp.java.
- Compile
hello$jsp.class.
- Load the jsp-servlet class.
- Create an instance of the jsp-servlet.
- Call the jsp-servlet's
jspInit() method.
- Call the jsp-servlet's
_jspService() method for each request. Repeat indefinitely. Multiple threads may call concurrently!
- Call the jsp-servlet's
jspDestroy() method.
- Unload the jsp-servlet class.
As with servlets, if Tomcat discovers
that the jsp file's timestamp has changed, it
- Calls the old jsp-servlet's
jspDestroy() method,
- Unloads the old jsp-servle class, and
- Starts a new JSP life cycle (translation step 1. above).