JSP life cycle
jsp page will participate in translation phase in the following cases:
- At the time of first request
- If the source code of the jsp got modified when compared with earlier request.
- For this,jsp engine uses “ARAXIS” tool_to compare time stamps of .jsp and .class file.
- .class file time stamp should be recent.
- While performing translation or compilation, if any problem occurs then we will get Http status500(Http500)
Pre compilation of JSP
- Usually translation phase of jsp will be performed at the time of first request.
- We can initiate translation phase explicitly by pre compilation process. we can initiate pre-compilation by using request Parameter “jsp-precompile.”
- We can send the request for pre initialization of jsp as follows
- This is not a request to the jsp,This is the request for execution until jspInit() method.
The main advantage of jsp preCompilation are
- All requests are processed with uniform response time
- We can fix translation time and compile time problems before processing any request.