tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: retrieving two different objects from session (should be thesame)
Date Thu, 08 May 2008 15:51:28 GMT
Hash: SHA1


Caldarale, Charles R wrote:
|> From: Christopher Schultz []
|> Subject: Re: retrieving two different objects from session
|> (should be thesame)
|> My tenuous understanding of session handling in Tomcat
|> is that HttpServletRequest.getSession roughly returns:
|> new StandardSessionFacade(theRealSessionObject)
| Don't think so.  I just took a look at the code, and it appears to me
| that the facade is only created once per session, not once per
| getSession() call.

Okay. I was looking around for that before I sent my message, but I
started to get lost in the Request versus Request versus StandardRequest
versus HttpSevrletRequest versus whatever else is in there.

| I did think of another issue with this situation:  if the attribute
| under discussion is only relevant for one particular request, it's a
| design flaw to store it in the session.


| It should be saved in the
| request instead, thereby avoiding any concurrency issues.  Since the OP
| didn't really give us much information about the lifetime of the
| attribute, I just assumed it had session scope.

Yeah. I'm wondering if he's using some type of form processing library
that re-writes the "form" object in the session each time. Struts, for
example, allows you to define forms for processing to have "session"
scope, and it will create the object and stuff it into the session for
you. There's no guarantee that the form object itself will survive
multiple requests, though the form should always be available. It's
possible that a new object would be created and actually replace the
in-session object, though I don't think that's actually how it's

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message