• Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue with passing data from one jsp to another using sendRedirect method

 
vishnu bola
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

can someone help me how to pass data from one jsp to another using sendRedirect method.

page1 --> page2--> page3-

page1 calls page2 which has a redirect o page3.

This is how iam doing it in my jsp.


When i print the values i get the data showing up on this screen but not sure if this is the right approach to send this data to another jsp. Please advise.

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're saying the iusermetaid values are getting passed? I don't see how, but I'm also finding it a little difficult to make sense of your code.
 
veeresh soni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
y don't you use request.setAttribute() method
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soni, we cannot user request.getAttribute as bola is using request.sendredirect. Send redirect will not carry request and session objects.

Bola, is it specific to user reqeust.sendRedirect. If yes then only way to pass is to append in URL.

If you can use requestDispatcher then you can store these values in request or session object and get in other JSP.

Is there any specific purpose of using request.sendRedirect. If not use ReqestDispatcher.

-Sunil
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xsunil kumar wrote:Soni, we cannot user request.getAttribute as bola is using request.sendredirect. Send redirect will not carry request and session objects.

Bola, is it specific to use reqeust.sendRedirect. If yes then only way to pass is to append in URL.

If you can use requestDispatcher then you can store these values in request or session object and get in other JSP.

Is there any specific purpose of using request.sendRedirect. If not use ReqestDispatcher.

-Sunil
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xsunil kumar wrote:Is there any specific purpose of using request.sendRedirect. If not use ReqestDispatcher.


By the way : it is response.sendRedirect not request.sendRedirect
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks seetharaman for update. Actually that was my request. request dispatcher is associate with response but request.

Thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!