Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

request Attribute vs session attribute

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Action class, I have set one parameter in request scope using request.setAtrribute("status","true");
Now it is forwarded to one jsp, in that i tried to retrieve the parameter using
request.getAtribute("status");
but i am getting that parameter as null in request scope of jsp.
it is not redirected it is simply forwarded to that jsp.

is it that the new request being created when forwared to jsp?
what should be the possible reason behind it.?

if i used session Atrribute it is working fine.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, forwards pass the same request object to resources in the chain.

Something else is going wrong.
If this is a Struts app, let me know and I'll move it to our Struts forum where you will probably get better help than you would here.
 
abhijit Ohal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ben ,

Thanks Ben .
Yes , it is Struts application.
it would be great help you do so
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, Every time when Jsp get the request, new request is being created.
But then what will be the alternative solution for this. Of course not "session"
 
reply
    Bookmark Topic Watch Topic
  • New Topic