This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

One JSP to another and then back  RSS feed

 
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Suppose I have 2 JSP pages A and B. I have some data on A page. I want to forward this data on B. With RequestDispatcher I can do that.

Now I want to forward the same data on A again. Should I again add this data on request attribute and then forward this request to A through RequestDispatcher???

Thanks a lot.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No that request will be lost when your jsp page return the data to the browser , so you can add that data to the session attribute and get it in first page
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Hemant Agarwal:
No that request will be lost when your jsp page return the data to the browser , so you can add that data to the session attribute and get it in first page



Yes, but after returning the data. So can't I add this data to request and then forward...

Thanks.
[ December 10, 2005: Message edited by: rathi ji ]
 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No that request is lost. Get the attributes from request and set it in to the session as attributes
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Hemant Agarwal:
No that request is lost. Get the attributes from request and set it in to the session as attributes



But I don't want to create session!!!

 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again you can remove attributes by using removeAttributes
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rathi,
Your question is very hard to understand.
More importantly, it's in the wrong forum.

Moving to JSP.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by rathi ji:
Suppose I have 2 JSP pages A and B. I have some data on A page. I want to forward this data on B. With RequestDispatcher I can do that.

Now I want to forward the same data on A again. Should I again add this data on request attribute and then forward this request to A through RequestDispatcher???



Yes. But that would be a new request.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!