1 Principles of JSP
1 The Web container transforms the JSP into a Java source file through the JSP engine;
2 The Java source file is compiled into class file by Javac;
3 Finally, the Web container loads the class file into memory by the ClassLoader, and responds to the client.
2 jsp execution process:
1 First, the client makes a request (request) and requests access to the JSP Web page
2) Next, Jspcontainer the. jsp file to be accessed into the servlet source code (. java file)
3 Then, the generated servlet's source code (. java file) is compiled, generated. class files, and loaded into memory execution
4 Finally the result response (response) to the client
When you execute a JSP Web page file, you need to go through two periods: the translation period (Translationtime) and the request period (RequestTime).
Translation period: JSP translates into a servlet class (. class file).
Request period: When the Servlet class (. class file) executes, the response results to the client.
There are two main things to do during the translation:
(1) Translate JSP Web page into servlet source code (. java), this segment is called the translation period (translation time);
(2) Compile the servlet source code (. java) into a servlet class (. Class), known as the Compile Time (compilation times).
In fact, JSP is a servlet.