Old code creates a @SessionScoped @ManagedBean
(namely UserSession
) at the first request in a ServletFilter and puts it in the HttpSession
(if not already there).
Now what happens when some EL expression tries to access that ManagedBean the first time? I expected a second instance of UserSession
(one created manually and one from JSF). So I instrumented the constructor, @PostConstruct
and @PreDestroy
with a few logging statements. Now it seems JSF never creates the UserSession
- only the constructor is called.
Is this possible? Can JSF reuse that bean from HttpSession
? Is it legit to put @SessionScoped
beans in HttpSession
?