Am New to jsp I had to forward the name from one file to another. After a lot of dig I found the below code to be worked but it wasn\'t work. I have three jsp files like one
Consider the code below on how you can pass parameters between jsp pages. You can use the <jsp:forward ... >
to forward a request using this code:
<jsp:forward page="newjsp1.jsp">
<jsp:param name="par1" value="111" ></jsp:param>
</jsp:forward>
This will forward the response to newjsp1.jsp
with a parameter par1
and its value is 111
.
Now in newjsp1.jsp you can read this parameter using:
<jsp:scriptlet>
out.append(request.getParameter("par1"));
</jsp:scriptlet>
You can also share attributes between pages using the session
implicit Object... Possibilities are limitless...
Maybe you would like to check these pages out: