Java Learning -036-javaweb_005--JSP action ID-forward

Source: Internet
Author: User

The main function of JSP action is the corresponding processing according to the specified action.

First, Param action

Used to pass parameters to HTML files and JSP files, often combined with forward, include, plugin actions, Syntax format: <jsp:param name= "username" value= "admin"/>

Second, forward action

Forward action is used to request information forwarded to another page, it has only a page property, the syntax format is: <jsp:forward page= "url"/> If you need to pass parameters, the format is as follows:

<jsp:forward page= "url"/><jsp:param name= "username" value= "admin"/><jsp:param pass= "Userpass" value= "12345"/><jsp:forward>

Parameter description:

Page: A relative URL path

Name: The attribute is the name of the parameter

Value: Parameter value

Below through a simple code, to explain, the source code is as follows:

The forward.jsp source code is as follows:

<% @page    contenttype= "Text/html;charset=utf-8"%>

The forward.html source code is as follows:

Put the above two code in the same folder, start Tomcat, enter in the browser: http://localhost:8080/jsp/005/forward.jsp, open the page as follows:

At this point, Java Learning -036-javaweb_005-JSP Action Logo-forward successfully completed, I hope this article can give beginners javaweb you a reference.

Finally, very grateful to the pro-stop, I hope this article can be pro helpful. Warmly welcome the kiss to discuss together and progress together. Thank you so much! ^_^

Java Learning -036-javaweb_005--JSP action ID-forward

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.