• Post Reply Bookmark Topic Watch Topic
  • New Topic

One JSP to another and then back  RSS feed

 
ankur rathi
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.
 
Hemant Agarwal
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
 
Ben Souther
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.
 
Adeel Ansari
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!