Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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.
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!