• Post Reply Bookmark Topic Watch Topic
  • New Topic

request Attribute vs session attribute

 
abhijit Ohal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hello Ben ,

Thanks Ben .
Yes , it is Struts application.
it would be great help you do so
 
arun borse
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!