| Author |
How to pass value to other page
|
Gaurav Chhabras
Ranch Hand
Joined: Sep 21, 2005
Posts: 126
|
|
Hi I am using -: String name="myName"; RequestDispatcher disp = request.getRequestDispatcher("a.jsp"); disp.forward(request, response); now i want to pass this variable ( name ) to other page where i am forwarding the page and i write -: RequestDispatcher disp = request.getRequestDispatcher("a.jsp?name=<%= name%>"); disp.forward(request, response); but it is givimg error that String Constants are not closed properly, but when i write -: RequestDispatcher disp = request.getRequestDispatcher("a.jsp?name=amit"); disp.forward(request, response); then it works fine, could you please tell me the reason and what is the proper way. Thanks Regards Gaurav
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
If you're already in a scriptlet block, you don't need the JSP expression. Just use the variable.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: How to pass value to other page
|
|
|