As to storing the request instances, here's something of interest from the
Servlet 2.3 spec:

===
SRV.4.10 Lifetime of the Request Object
Each request object is valid only within the scpoe of a servlet’s service
method, or within the scope of a filter’s doFilter method. Containers commonly
recycle request objects in order to avoid the performance overhead of request
object creation. The developer must be aware that maintaining references to
request objects outside the scope described above may lead to non-deterministic
behavior.
===

You can certainly pull some data out of the request (params, properties, etc.)
and store that, but do not maintain a reference to the actual request object.

Quoting John Fitzpatrick <[EMAIL PROTECTED]>:

> This may be slightly off-topic for this list, but here goes anyway:
> 
> I'm working on a Struts site which must be i18n compatible and have a login
> system where some of the pages are protected. What I'm looking to accomplish
> is two fold:
> 
> 1. When viewing any page, including query results, be able to select a
> language from the pull-down menu and get the page the same page back in the
> new language.
> 
> 2. When requesting a page that is protected, have the user be prompted to
> authenticate and then receive the originally requested page. Or, have a
> login form on each page which will return the same page with just the login
> details changed.
> 
> To accomplish this, I attempted to store each HttpServletRequest in the
> session and then check for a language change, or login request, in an
> ancestor of each action, process that change and then serve the previous
> request. However, when I take the stored request out of the session, it's
> handle to the Session is now 'null.'
> 
> Has anyone had some experience attempting something like this, or am I
> barking up entirely the wrong tree here?
> 
> FWIW, I've looked at JAAS and don't feel that it suits our needs. The role
> handling is simply too coarse. 

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to