When a JSP page on the server is executed for the first time, the JSP engine on the server first translates the JSP page file into a java (java servlet) file, compiles the java file to generate a bytecode file, and then responds to the customer's request by executing the bytecode file. The task of this bytecode file is: 1. Give the ordinary HTML markup symbols in the JSP page to the customer's browser for display. 2. JSP tags, data and method declarations, and Java programs are executed by the server and sent to the customer's browser to display the results. 3. The Java expression is calculated by the server, converts the result into a string, and then hands it over to the customer's browser for display. So, in fact, all the execution that requires logical judgment has been completed on the server side, and all that is passed to the browser is a series of printed statements. The browser is only responsible for collecting and displaying data. If the user visits again, the JSP engine will directly find the compiled servlet file to run, which is why the JSP page will run faster than the page written in other languages (such as asp). Of course, we must realize that the first execution of JSP will be very slow, so the first run is usually handed over to the system administrator. |