In the upcoming example, we are going to forward the client request to another web page using the shortcut syntax of <jsp:forward> action, such as -
<jsp:forward page="URL" />
We are going to take user's inputs in a form on a web page EnterData1.jsp and as soon as the user press the submit button on the form, the information entered will be
sent to the web page JspForward.jsp(specified in the action attribute of <form> tag).
<title>Using JSP config object</title>
Name : <input type ="text" name="Username">
City : <input type="text" name="Cityname">
<input type ="submit" value ="submit">
Next, in JspForward.jsp web page, the information entered in the form passed to it by EnterData1.jsp is forwarded to another web page ShowData.jsp
and a new parameter named message is added using the <jsp:forward> action element.
Next, web page ShowData.jsp is displayed with the data entered by the user in the form on EnterData1.jsp and the value of parameter added to the request
using on the page JspForward.jsp, which is all accessed using the JSP's inbuilt request object.
As you can see in the output windows shown below, user's inputs taken in a form on a web page EnterData1.jsp, the information entered is sent
to the web page JspForward.jsp(specified in the action attribute of <form> tag).
the information entered in the form on EnterData1.jsp is forwarded to another web page JspForward.jsp,
where a new parameter is appended to the request using the
<jsp:forward> action and forwarded to ShowData.jsp, where all this information is displayed by using the forwarded JSP request object.