I'm working on a Java webapp trying to combine the following technologies:
- Java EE 6
- CDI
- JSF 2
- EJB 3.1
- Spring Security
I provide CDI-based backing beans (@ViewScoped, @Named) for my JSF pages.
I use @Stateless EJB beans for the actual work to be done.
I only need few session information like jSessionCookie (managed by container), internal username and some other internal IDs. Now, I wonder where to put this session information so that I can access it in the backing beans for JSF, but also provide it to the stateless EJBs? Should I use a @Stateful EJB session bean or should I create CDI-based POJO with @SessionScoped and @Named?
Are there any best practices?