• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reuqest not being propagated to next page

 
sridhar yenamandra
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have set an attribute in request scope in my jsp.On clicking button i go to another jsp where i am trying to retreive the attribute i set in the request. But here the value is null as if like no attribute is set.
Would appreciate any solution for this.

Thanks,
Sridhar.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each round trip to the server creates a new HTTP request and hence a new request instance. Your first request goes out of scope when the response is returned to the client.

If you want data to persist across request boundaries, do not store it in the request.

Perhaps the session would be abetter place. If so, be sure to remove the data from the session when no longer required.
 
Parambir Singh
Ranch Hand
Posts: 40
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On click of that button, instead of the simple url, use jsp:forward tag. that would use the same request object so your attribute will not be null later.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Param"
Thank you for changing your display anme, but it is still incorrect. Please read the following carefully:

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please correct your display name or your account will be deleted.

thanks,
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic