VbMonk
asked on
using variables in multiple pages
If I have declared my variables in a page called test1.jsp, I want to print out these variables in a page called test2.jsp. Is this possible? Please help!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
but data stored in "request" will not be available in all pages, its just the sessions taht can do.
>>> I want to print out these variables in a page called test2.jsp
the req is only for printing in the next page!!!!!
the req is only for printing in the next page!!!!!
in page1.jsp:
<%
String var = "something";
request.setAttribute( "theVar", var );
%>
and in other pages you can retrieve it with:
<%=request.getAttribute("t
or if you can have hidden field inside the form of your first jsp which will take the from from these defined variables then when the form is posted to the second jsp you will ge able to retrieve the values using
request.getParameter(Nameo