JSP (Java Server Page) -
JSP means java server page with in the JSP you can write java code with in html code.
System.out.println(“This is my first JSP Page”);
When any request will go for any jsp firstly JSP creates a Servlet for JSP and compiles to .class file then run over the web server.
JSP Life Cycle -
There are three methods defines Life Cycle of JSP Page.
_jspInit() Method -
_jspInit() method is called by jsp container for initializing the servlet of jsp page. This method is call at one time of any JSP life.
_jspService() method is called when any request is send by the client for providing the response on this JSP Page.
_jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
_jspDestroy() Method -
_jspDestroy() method is called by jsp engine when server has gone to shut down. Like jspInit() method, you can override the jspDestroy() method also to do your all clean up such as release the resources