Static include and dynamic include in JSP

Source: Internet
Author: User

In JSP, include has two forms:
<% @ Include file = "%>
<JSP: Include page = "flush =" true "/>
(Note: Like other JSP elements, the include behavior element ends with "/" when there is no behavior body, just like the following.
<JSP: Include page = "<% = pageselectedatruntime %>" flush = "true"/>)

The following are the differences between the two include methods:
There are two main differences;
I. execution time:
<% @ Include file = "relativeuri" %> is executed in the translation phase
<JSP: Include page = "relativeuri" flush = "true"/> it is executed in the request processing stage.
Ii. Differences in introduced content:
<% @ Include file = "relativeuri" %>
Introduce static text (HTML, JSP) and combine it before the JSP page is converted into a servlet.
<JSP: Include page = "relativeuri" flush = "true"/> introduce the response text generated by the execution page or servlet.
In addition, both the file and page attributes are interpreted as a relative Uri. if it starts with a slash, it is an environment-related path. it will be interpreted based on the prefix of the URI assigned to the application. If it is not starting with a slash, It is the page-related path. It will be interpreted based on the path of the page that introduced this 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.