JSP programming (II)-JSP basic syntax (9)-JSP: Include

Source: Internet
Author: User

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>

Example

<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>

 

Description

<JSP: Include> elements allow you to include dynamic files and static files. The results of these two types of files are different. If the file is only a static file, this inclusion only adds the content of the contained file to the JSP file. If the file is dynamic, the included file will be executed by the JSP compiler (similar to ASP)

You cannot determine whether a file is dynamic or static from the file name, suchAspcn. asp

It may only contain some information and does not need to be executed. <JSP: Include> these two types of files can be processed at the same time. Therefore, you do not need to determine whether the file is dynamic or static.

If the file is dynamic, you can also use <JSP: param> to pass the parameter name and parameter value.

Attribute

    • 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". You cannot use false. The default value is false.

    • <JSP: Param name ="Parametername"Value = "{Parametervalue| <% =Expression% >}"/> +

      <JSP: param> the clause allows you to pass one or more parameters to a dynamic file.

       

      You can use multiple <JSP: param> in a single 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.