Forwards a client request to an HTML file, JSP file, or servlet for processing.
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
The
You can pass parameter names and values to the target file by using a
Be careful when using
Attributes
# page="{relativeURL | <%= expression %>}"
A String or an expression representing the relative URL of the file to which you are forwarding the request. The file can be another JSP file, a servlet, or any other dynamic file that can handle a request object.
The relative URL looks like a path-it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP file. If it is absolute (beginning with a /), the path is resolved by your Web or application server.
# <-jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" />+
Sends one or more name/value pairs as parameters to a dynamic file. The target file should be dynamic, that is, a JSP file, servlet, or other file that can process the data that is sent to it as parameters.
You can use more than one
No comments:
Post a Comment