Em Thu, 01 Oct 2009 11:16:15 -0300, <[email protected]> escreveu:
The OssoAccessControllerImpl gets some authentication info from the
request and creates a User object.
I want(ed) to store this object into the session, so I need an
ApplicationStateManager, because the @Session annotation can't be used
here (we're in a service). The ApplicationStateManager can be injected
into the OssoAccessControllerImpl constructor, so the latter must be
request specifice, i.e. per thread.
It still doesn't need to be per thread. You can even inject Request or
HttpServletRequest in a singleton service and you still get the right
instance when you invoke some method on them. The instance that is
injected is a proxy, not the real object, and this proxy delegates the
method calls to the correct instance for that given thread.
However, your comment made it clear to me that I could put the User
object into the request instead of into the session. Then, I can fetch
it via the Request service which can be injected wherever I would have
used @Session
private User user; ! This is much better! Thanks!
You're welcome!
I'm still astonished there are so many of them.
How many assets do you have in your page? I guess it's 7. :)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]