• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • 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"
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic