JSP page Tomcat deployment does not take effect __JS

Source: Internet
Author: User

Today encountered a problem, the updated JSP page deployed to the server under Tomcat, the page does not take effect. Finally know that there is no clear reason for Tomcat's work directory, now to learn about Tomcat's related principles

Tomcat's principle is that when a browser accesses a page, Tomcat turns the JSP page into a. java file in the work directory. For example, convert index.jsp into Index_jsp.java, and then compile into Index_jsp.class file, finally tomcat through the ClassLoader class to load this index_jsp.class class into memory, the client work.

Tomcat periodically scans the container for JSP files, reads the attributes of each file, and when a JSP file is found to be changed (the file's last modification time is different from the last scan), Tomcat converts and compiles the JSP file again. But the Tomcat scan is not real-time, which is why the JSP page changes to wait a few minutes clock such as JSP page entry into force. For immediate effect, it is recommended that the contents of the work directory be purged immediately after the JSP page has been modified. In addition, in the Tomcat container, the compiled Java files (such as Index_jsp.java) have only 64kb of compilation, so when you migrate the JSP into the Tomcat container in the other container, you will encounter a situation where the JSP file will not compile. Therefore, it is recommended that the JSP business logic to write a separate class, in the JSP page by calling the class in the static method to execute, and the JSP in JS extracted out into a separate JS implementation.

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.