Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 17th, 2002, 02:07 PM
a_developer a_developer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 0 a_developer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old January 17th, 2002, 07:20 PM
midntrdr midntrdr is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 45 midntrdr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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?

Reply With Quote
  #3  
Old January 29th, 2002, 08:13 AM
codeguru codeguru is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 1 codeguru User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Forwards and requests.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT