JSP implementation Principle __JS

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.