JSP Syntax (10)--

Source: Internet
Author: User
Tags expression flush include relative
js| Grammar <jsp:include>


Contains a static or dynamic file.






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>



Examples




<jsp:include page= "scripts/login.jsp"/>

<jsp:include page= "copyright.html"/>

<jsp:include page= "/index.html"/>



<jsp:include page= "scripts/login.jsp" >

<jsp:param name= "username" value= "jsmith"/>

</jsp:include>







Describe


<jsp:include> elements allow you to include dynamic files and static, and the results of the two include files are different. If the file is just a static file, then this includes simply adding the contents of the containing file to the JSP file, and if the file is dynamic, the included file is also executed by the JSP compiler (which is similar to the ASP)


You can't tell whether a file is dynamic or static from the filename, such as aspcn.asp

It is possible to just contain some information and not perform it. <jsp:include> can process both files at the same time, so you don't need to include them and decide whether the file is dynamic or static.


If the inclusion file is dynamic, you can also pass the parameter name and parameter values with <jsp:param>.






Property




Page= "{relativeurl | <%= expression%>}"
The parameter is a relative path, or an expression that represents a relative path.





Flush= "true"
Here you must use Flush= "true" and 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 arguments to a dynamic file


You can use multiple <jsp:param> in one page to pass multiple parameters.


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.