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.