JSP syntax (8)

Source: Internet
Author: User

<Jsp: forward>
Redirects an HTML file, JSP file, or program segment.

JSP syntax

<Jsp: forward page = {"relativeURL" | "<% = expression %>"}/>

Or

<Jsp: forward page = {"relativeURL" | "<% = expression %>"}>

<Jsp: param name = "parameterName"

Value = "{parameterValue | <% = expression % >}"/> +

</Jsp: forward>

Example

<Jsp: forward page = "/servlet/login"/>

<Jsp: forward page = "/servlet/login">

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

</Jsp: forward>

Description

<Jsp: forward> the tag transfers a request object containing user requests from one JSP file to another. <jsp: forward> the code below the tag cannot be executed.

You can send parameters and values to the target file. In this example, the parameter name is username and the value is scott. If you use the <jsp: param> label, the target file must be a dynamic file that can process parameters.

If you use non-buffered output, be careful when using <jsp: forward>. If the jsp file already has data before you use <jsp: forward>, the file execution will fail.

Attribute

Page = "{relativeURL | <% = expression %> }"
Here is an expression or a string used to indicate the file or URL you want to target. this file can be JSP, program segment, or other files (such as asp, cgi, php) that can process request objects ).

<Jsp: param name = "parameterName" value = "{parameterValue | <% = expression % >}"/> +
Send one or more parameters to a dynamic file. This file must be a dynamic file.

If you want to pass multiple parameters, you can use multiple <JSP: param> In a jsp file. Name specifies the parameter name and value specifies the parameter value.

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.