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?
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.