The difference between JSP and HTML

Source: Internet
Author: User

Reference link: http://blog.csdn.net/xuaman/article/details/69390301 static page, generally referred to as HTML:

In a static Web program, the client uses a Web browser to connect to the server, uses the HTTP protocol to make a request, tells the server that it needs the page now, all the requests are given to the Web server, and then the Web server extracts the content from the file system based on the user's needs. Then returns to the client, the client receives the content after the browser resolution renders, obtains the display effect

In order to better look at static Web pages, using JS, Ajax, but these are in the client with the browser display to the user, so the server itself does not have any changes

Static Web page cannot connect to database

Static Web page Resource development technology: HTML

Due to the current Web page, a large number of use of JS, causing the browser to open the page, will occupy a lot of memory, so that the pressure of the server is reduced, but the pressure of the client increased

Dynamic Web pages, commonly referred to as JSPs:

In the Dynamic web, the program still uses the client and the server, the client still uses the browser, connects to the servers over the network, initiates the request through the HTTP protocol, and now all requests need to be processed by a Web server, if the client requests a static resource (*.html or *). HTM), the request is forwarded directly to the Web server, after which the Web server extracts the content from the file system, sends it back to the client browser to resolve the rendering, and if the client requests a dynamic resource (*.jsp, *.asp, *.aspx, *.php), the request is now forwarded to the Web Container, in the Web container connected to the database, from the database to take out data, such as a series of dynamic pieces of the display of the page, pieced together the content of the page, the display of all the content to the Web server, The content is then sent to the client browser through the Web server for parsing rendering

Further in-depth analysis of the Dynamic Web Access process: When the browser accesses the Web, does not directly access the JSP page, in fact, the first to access the Web container (usually tomcat), the server created a good req and Resp objects and then to the JSP page use, After setting the character set in the JSP and getting the form parameters, call the servlet, complete the business process, and then return to jsp,jsp will generate the corresponding HTML page, the page will be returned to the server, and then by the server, through the response object returned to the client

Why do I need a Web server? (Web server)

(1) No matter what Web resources, if you want to be accessed by a remote computer, you must have a corresponding network communication program, when the user accesses, the network communication program reads the Web resource data, and sends the data to the visitor

(2) Web server is such a program, it completes the underlying network communication, processing the HTTP protocol, the use of servers, developers need to focus on how to write Web resources, without concern about how resources are sent to the client, which greatly reduces the developer's development tools

Common Dynamic Web resource development techniques: Jsp/servlet, ASP, PHP, etc.

The difference between a static page and a dynamic page:

1 static page content is immutable, can be opened directly with a local browser; Dynamic page content is generally generated by the program relying on the server, different people, different times to access the page, the content may be different

2 HTML is an interpreted language, do not need to specify the compiler tool, as long as the TXT document to write HTML tags can be normal display, JSP is the Java Server page, fourth dynamic, after the JDK compiled content sent to the client to display

3 HTML and JSP header is not the same, this is the head of the JSP "<%@ page language=" java "import=" java.util.* "pageencoding=" GBK "%>" in the table header has encoded format and poured into the package and so on. is also very well differentiated, in the JSP with <%%> can write Java code, and HTML does not have <%%>

The difference between JSP and HTML

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.