Difference between JSP and HTML, and difference between JSPHTML

Source: Internet
Author: User

Difference between JSP and HTML, and difference between JSPHTML

 

HTML(Hypertext Markup Language) The text Markup Language is a static page. It is the same as an explanatory Language as JavaScript. Why is it an explanatory Language? Because, as long as you have a browser, it can be displayed normally, without the need to specify the compilation tool, you only need to write the HTML mark in the TXT document.

JSPJava Server Page, after the Java file is compiled, a class file will be generated, and the class file will be executed eventually. The same is true for JSP. It will also be compiled into a class file! JSP not only needs to be compiled, but also needs to be translated. First, convert JSP into a Servlet File and then compile it into a class file. When you access JSP, the class file is executed.

 

Personal summary:

1. The simplest difference is that HTML can be opened directly. jsp can only be opened on servers such as Tomact.
2. the HTML page is defined as a static page that can be directly run, and the JSP page is a dynamic page that needs to be converted to servlet during running.
3. their headers are different. This is the JSP Header "<% @ page language =" java "import =" java. util. * "pageEncoding =" UTF-8 "%>" contains the encoding format in the header and the imported package.
4. Java code can also be written in jsp, but html does not <%>
5.html is a w3c standard webpage writing format. It is a unified protocol language and a static webpage. Most of the web pages we view online are based on html. Jsp is a dynamic language. jsp can implement all html tasks.
  
Advantages and disadvantages of front-end Interaction: 1. advantages of ajax: (1 ). in the development process, the frontend and backend are separated and interaction is achieved through JSON transmission (2 ). strong cross-platform capabilities, relying on browser support (3 ). enable the background data interface to be reused. 2. disadvantages of ajax: (1 ). it is difficult to develop, considering the compatibility of browsers (2 ). too many page requests (3 ). it is post-loaded and cannot be crawled by crawlers (4 ). interface code needs to be added a lot (5 ). you cannot directly display java object classes. You need to convert them to json format. 3. advantages of jsp: (1 ). crawlers can crawl (2 ). reduce the number of requests (3 ). do not consider the compatibility of the browser 4. disadvantages of jsp: (1 ). increased the pressure on the server (2 ). the front-end and back-end are not separated and the development progress is slowed down (3 ). too dependent on java Runtime Environment (4 ). low reusability
  
 
 

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.