1. The user makes a request. index.jsp
Whether to request this page for the first time, if so, the JSP engine converts the JSP file into a servlet, generates a bytecode file, and then executes the Jspinit () method. Executes only once when the bytecode is generated. The entire life cycle is performed only once. If it is not the first time, it will start parsing the bytecode directly. Then execute the Jspservice () method of the Servlet class.
Jspservice () method Description: For each request, the JSP engine creates a new thread to handle the request. This creates multiple threads if there are multiple simultaneous requests from the client. Each client corresponds to one thread. Note the thread synchronization issue. The servlet resides in memory. So the corresponding speed is very fast.
is the work directory that is stored in Tomcat.
If the JSP page changes, the corresponding bytecode is regenerated.
Java Learning-jsp page cycle