|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Forwards and requests.
I have a page that receives some data posted from another page. If on that page I do jsp:forward to a third page, can I use request.getParameter(...) on the third page to retrieve the data originally posted to the previous page. In other words, does the request object preserve its data accross multiple jsp:forward's?
|
|
#2
|
|||
|
|||
|
I haven't worked with jsp much, but I work with servlets everyday. I'm not sure if jsp:forward would work on the third page, but I know for sure that you could get the paremeters on the second page and put them in a session variable that would be available on the third page or any other page.
Just a thought ..... But maybe someone else that knows more about jsp would have a better solution? |
|
#3
|
|||
|
|||
|
The simple answer is yes. A forward is an in memory transition unlike a redirect. The forward tag gets translated into something like this by the JSP engine:
getServletContext().getRequestDispatcher( path ).forward( request, response ); As you can see forward is a simple method call (in memory transition), the orignal request and response objects are passed as parameters to forward therefore the next page will have access to all the parameters. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Forwards and requests. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|