JSP basic syntax five jump instruction

Source: Internet
Author: User

The function of the jump:

You can use a jump instruction to transfer a user's request from one page to another page.

For example: User login QQ space, if the user name and password correct words will jump to the home page, otherwise it will jump to the failure page.

Syntax for jump directives:

Do not pass parameters <jsp:forward page= ""/>

Passing parameters: <jsp:forward page= "" >

<jsp:param name= "parameter name" value= "parameter Content" >

</jsp:forward>

Let's look at a program instance:

forward_01.jsp

 

Forward_02.jsp (This is the display page after the jump)

<%@ page contenttype= "text/html" pageencoding= "GBk"%>    
 

A run can be found that the page did jump.

Notice here:

There is no change in the address bar now so this kind of jump, in the actual development of the server side of the jump, because the page after the jump changes, but the address bar has not changed

But when there is only one parameter, that is, if the accepted parameter is not enough, then the return is null

Jump instructions Note the problem:

1. The syntax of the jump instruction is used more, the attention distinguishes contains the instruction.

2. Emphasis must be placed on "/" to end the labeling instructions;

This article is from the "Zhao Yuqiang blog" blog, please be sure to keep this source http://zhaoyuqiang.blog.51cto.com/6328846/1126971

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.