I'm trying to keep the 3 Tier architecture. I'd like to have a JSP page for presentation with a value. I then pass the value of that variable to the servlet using the request.getParameter method. I perform some operations with the variable. Now when I redirect from my servlet to a new JSP, how can I get the value of that variable?
Joined: Aug 13, 2001
Whenever u pass a form fiels as a part of request its just for the request. You can get it only in the servlet. When you invoke another jsp or servlet from it.. the values are no more part of the request. There are two ways to get the values on the next page also.. 1. put it in the session. But one should be very careful about putting anything in to session. because if the session gets too heavy it hampers the performance of the application. 2. another way is that when invoking a jsp/servlet from the servlet put the value as a hidden field or as a wuery string. hope it helps.. -kaustubh.
Kaustubh. Mumbai, India.
Joined: Nov 06, 2000
Chris, instead of redirecting, you can use the forward method of the requestDispatcher. In this case the rquest object is available to the JSP.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley