Hey all,
I am using Seam 2.2.1.CR1 on Weblogic 10.3.2 and JSF 1.2.
I have an ear application with 2 war files. The first war is a JSF / Seam application, the second one does have JSF / Seam, but also has some Servlets pages as well.
When I set things in the Session context in the first web application:
Contexts.getSessionContext().set("pimUser", pimUser);
I can inject it normally in Seam components in the second war. However, if I try to get the outjected pimUser from a Servlet, I cannot access it:
PimUser user1 = (PimUser) Contexts.getSessionContext().get("pimUser");
The Contexts.getSessionContext() is null. I noticed that the Javadoc of the
org.jboss.seam.contexts.Contexts
Says:
Provides access to the current contexts associated with the thread.
Author(s): Gavin King Thomas Heute
Does this mean that the 2 war files are supposed to have different Contexts.getSessionScope()
?
I found a way which does allow me to access it through the Session like this:
PimUser user2 = (PimUser) httpRequest.getSession().getAttribute("pimUser");
The latter way, however does not seem to be a correct one. I would like to access Seam session context through Seam.
I found that there used (?) to be issues with Seam and multi-war applications (link), however, these are supposed to have been resolved by 2.2.0.GA.