Difference analysis of dynamic include and static include in JSP _jsp programming

Source: Internet
Author: User
Dynamic include
Implement <jsp:include page= "included.jsp" flush= "true" with jsp:include actions/> It always checks for changes in the contained files, suitable for inclusion of dynamic pages, and can take parameters.
Static include
Implemented with include pseudo code, will not check the file contained changes, applicable to include static page <%@ include file= "included.htm"%>

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

1. The result of static include is to introduce the other JSP into the current JSP, which is integrated together.
The dynamic include structure is independent of the two until the output is merged (look at the JSP generated Java file to know)

2. It is because of this, dynamic include JSP file independence is very strong, is a separate JSP file, need to use the object, page settings, must have their own creation, of course, fortunately it and include its page of the request scope is consistent.

Static include is simply a shared method of writing code outside, all variables can be shared with its main file, which is highly cohesive and cannot have conflicting names of variables. Page settings can also be borrowed from the master 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.