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