Introduction to include directives in JSP __jsp

Source: Internet
Author: User

1. Introduction

The include directives in the JSP are in the form of:
<%@ include file= ""%>
Typically, include is considered when parts of all pages in an application, such as headers, footers, and navigation bars, are the same. The include directive element of the <%@ include file= ""%>,jsp reads the contents of the specified page. and combine the content with the original page. (This process is in the translation phase: that is, the JSP is translated into a servlet stage.) )


2, and jsp:include action instructions are different

There are two main differences between include and Jsp:include;
 The first is the execution time:
<%@ include file= "Relativeuri"%> is performed during the translation phase
<jsp:include page= "Relativeuri" flush= "true"/> executes at the request processing stage.
 The second is to introduce the different content:
The <%@ include file= "Relativeuri"%> introduces static text (html,jsp) and brings it together before the JSP page is converted to a servlet.
<jsp:include page= "Relativeuri" flush= "true"/> Introduces the response text generated by the execution page or servlet.
In addition, both the file and Page properties are interpreted as a relative URI in both usages. If it starts with a slash, it is an environment-related path. will be interpreted according to the prefix of the URI assigned to the application, if it is not preceded by a slash, then the page-related path. Explain the path to the page where the file was introduced.


Reference: Baidu Encyclopedia

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.