Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: Setting parameters in HttpSevreletRequest Object


Message #1 by "Lakshmi" <lbalasubramanyam@y...> on Thu, 8 Aug 2002 14:57:44
yep it clarifies my doubt. Thanks.
> Hi

>WIll any of the parameters set in the HttpServeletRequest Object persist
>beyond a user session??I mean, Will the old value set in the
>HttpServeletRequest object using its setParameter method be available for
>a next usersession using the getParameter method??

First point about the HttpServletRequest object is that it does not have a
setParameter method.  It does, however, have a getParameter method so I'll
assume this is what you meant.

Once a single request is dealt with, and a response returned to the client,
any parameters originally sent by the client and included in the
HttpServletRequest object are discarded as is the HttpServletRequest object
itself.  If you want the parameters sent by the client  to be saved in the
users HttpSession object you must explicitly save then in the session.  
Once
the session expires, or is invalidated, any information in the session and
not saved anywhere else is lost.

So if you want the data to persist you must save it.

From the client side (assuming a browser type client), any parameters sent
in a request will not be sent in a subsequent request unless you
deliberately return them to the client in a new form or include them in the
url's for links.  Of course the user could go back in the borwsers history
and resubmit the original page (and parameters).

Not 100% sure if this answers your question so if not please clarify.

Hope this helps,
Andrew
Professional Java Servlets 2.3
http://www.amazon.com/exec/obidos/ASIN/186100561X
http://www.amazon.co.uk/exec/obidos/ASIN/186100561X

-----Original Message-----
From: Lakshmi [mailto:lbalasubramanyam@y...]
Sent: 08 August 2002 14:58
To: Servlets
Subject: [servlets] Setting parameters in HttpSevreletRequest Object

I have a simple question..

WIll any of the parameters set in the HttpServeletRequest Object persist
beyond a user session??I mean, Will the old value set in the
HttpServeletRequest object using its setParameter method be available for
a next usersession using the getParameter method??
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to 


  Return to Index