• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing values between two JSPs

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been banging my head for more than a day now to resolve this issue.. grateful if anyone can offer help... I'm trying to fix a bug in a legacy application in my organization.. in one of the jsp pages..

pag1.jsp



The Servlet1 is calling another Servlet2, which in turn calls Servlet3 to print some code to page1.jsp.. one page1.jsp is compiled html output looks like this..
page1.jsp output..



I need to be able to pass "param" value from page1.jsp to page2.jsp. request.setAttribute is not working. The Servlet class Servlet3 is vendor provided so I cannot set a hidden form variable inside form "yy" to pass it to page2.jsp.

if anyone has a solution please help me, Thanks in advance.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If they are not in the same request you cannot use request scope as each request has its own scope. Have you considered using the session?
 
chintu reddy
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I tried using Session and it was working... but was wondering if there will be any other options and also any disadvantages of using sessions...
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is exactly the type of thing sessions were created for. Why not use the proper tool in the manner that the tool was intended to be used?
 
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic