How JSP generates static pages

Source: Internet
Author: User
The homepage of common category information must read at least six databases. Other Sub-pages may or may not exceed a dozen times.

When using the database connection pool, Tomcat can support a very limited amount of concurrency. System resources are mainly consumed in two aspects:

  1. database operations, frequently returning results from the database;

  2. Tomcat parses the JAVA file.

The process of creating a. HTML static page based on a specific rule is called static page generation.

  Advantages

No need to access the database, saving the maximum system consumption.

Tomcat directly returns .html static files without parsing java files to maximize efficiency.

Security, avoiding errors caused by Invalid parameter passing.

  Disadvantages

The generated large size. HTML static page requires a large amount of hard disk space.

The interactive performance of dynamic pages is lost.

The stable running dynamic page is the prerequisite for generating the. HTML static page.

At the beginning, the. html page is a dynamic page that is frequently used by the system (capture and capture the dynamic page, and save it as the. html file). Therefore, this part of the capture operation is generated.
As the core of a static page, how to minimize the number of captured parsing operations depends on dynamic pages (for example, how the jsppage is saved by the rules. HTML static pages, how to use static pages and
User interaction is also unavoidable. The following points are summarized:

  1. Define rules

Replacement.

  2. Path

If .html has too many static pages, it will inevitably be stored in different folders.

Specifying an absolute path starting with the root directory on all JSP pages is one of the solutions.

  3. Interactive Performance

Static pages inevitably lose the interactive performance, for example, the number of times the information is read and the session information cannot be obtained. However, it is not a solution.
A dynamic page can be a. HTML static page or. Jsp dynamic page. For example, A. Jsp file with Zero height and zero width can be nested for statistics.
The number of times the information is read.

  4. Optimization

Embedding a page, and nesting all static pages into such a file can help reduce the page size. (Note that this volume can only reduce the page file size, but does not help improve access efficiency)

  5. Risks

It is a matter of consideration.

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.