• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 41
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
y don't you use request.setAttribute() method
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks seetharaman for update. Actually that was my request. request dispatcher is associate with response but request.

Thanks again.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic