Difference between dynamic and static include in JSP

Source: Internet
Author: User

Dynamic include
Use the JSP: include action to implement <JSP: Include page = "added ded. JSP "Flush =" true "/> always checks for changes in the contained files. It is suitable for inclusion of dynamic pages and can contain parameters.
Static include
Implemented by using the include pseudo code. Changes to the included files are not checked. This applies to static pages that contain <% @ include file = "included.htm" %>

========================================================== ======================================

1. The result of static include is to introduce other JSP into the current JSP.
The dynamic include structure is independent of the two and will not be merged until the output (you can see the Java file generated by JSP)

2. it is precisely because of this that the dynamic include JSP file is highly independent. It is a separate JSP file, and the objects and page settings that need to be used must all be created by yourself. Of course, fortunately, it is consistent with the request range of the page that includes it.

Static include is simplyCodeA sharing method written outside. All variables can be shared with the main file that includes the variable. The two are highly tightly combined and cannot conflict with the same name of the variable. the page settings can also borrow the main file.

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.