File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes reuqest not being propagated to next page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "reuqest not being propagated to next page" Watch "reuqest not being propagated to next page" New topic
Author

reuqest not being propagated to next page

sridhar yenamandra
Greenhorn

Joined: Jul 27, 2004
Posts: 19
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

Joined: Jan 10, 2002
Posts: 61103
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Parambir Singh
Ranch Hand

Joined: Sep 05, 2004
Posts: 40

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.


SCJP, SCMAD
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"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.
 
Consider Paul's rocket mass heater.
 
subject: reuqest not being propagated to next page