I have the Seam session-scoped component, CustomIdentity which overrides the standard Seam Identity (also session-scoped). The extended CustomIdentity has a property
@Out(required=false, scope=ScopeType.SESSION)private User user
In the overriden login() I define a User object, populated with information from the Principal of the HttpServletRequest. In the first request in the application the User object is outjected as expected in SESSION scope. In the second request, though, the User object has vanished from the Session, and when I visit a page that Injects it, I get an exception.
My question is when exactly the component is outjected:
- After each and every one method of the CustomIdentity component (even if it does not contain a reference of
user
)? - After each method that contains a reference of the User component?
And about the required
attribute:
- If upon outjection the User object evaluates to
null
, is the already outjected User going to be removed from Session scope?
Cheers!