File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSP
Bookmark "reuqest not being propagated to next page" Watch "reuqest not being propagated to next page" New topic

reuqest not being propagated to next page

sridhar yenamandra

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.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

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] [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.

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

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.

I agree. Here's the link:
subject: reuqest not being propagated to next page
It's not a secret anymore!