1. Introduction
Include action directives can dynamically include a file in a JSP page, the contents of which can be static files or dynamic scripts, and the JSP engine can dynamically compile and update the included dynamic files when they are modified. If the inclusion file is dynamic, you can also pass the parameter name and parameter values with <jsp:param>.
2. JSP syntax
<jsp:include page= "{relativeurl | <%= expression%>}" flush= "true"/>
Or
<jsp:include page= "{relativeurl | <%= expression%>}" flush= "true" >
<jsp:param name= "ParameterName value=" {parametervalue | <%= expression%>} "/>+
</jsp:include>
2.1 Properties
Page= "{relativeurl | <%= expression%>}", the argument is a relative path, or an expression that represents a relative path.
Flush= "true", where you must use Flush= "true", you cannot use false values. The default value is False
<jsp:param name= "ParameterName" value= "{parametervalue | <%= expression%>}"/>+,<jsp:param> clause allows you to pass one or more parameters to a dynamic file, and you can use multiple <jsp:param> in one page to pass multiple parameters.
3, Example
3.1 contains dynamic files
<jsp:include page= "scripts/login.jsp"/>
3.2 contains static files
<jsp:include page= "copyright.html"/>
<jsp:include page= "/index.html"/>
3.3 Pass <jsp:param> Pass parameters
<jsp:include page= "scripts/login.jsp" >
<jsp:param name= "username" value= "jsmith"/>
</jsp:include>
Reference: Baidu Encyclopedia