[EJB 3.0] - Re: EAR Scoped PersistenceUnit
by mzeijen
I discovered that in AS 4.2 with a JEE5 application.xml file all normal jars in the Lib process are added to the classpath but the file containing the persistence.xml needs to be added to the application.xml as a java module.
I also found a workaround for my Global persistence unit. By using some life cycle interceptor and a custom annotation I inject the persistence context from the JNDI into the persistence manager field. The injector finds the JNDI path of the persistence context via a configuration file that I put on the classpath in lib aEJB3Lib.jar. This way i can reuse my DAOEJB3Lib.jar and on runtime tell it which persistence unit to use.
But I still think that it is a bug that persistence units become global. What do you think?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079871#4079871
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079871
17Â years, 1Â month
[JBoss Seam] - Re: Problems with scopes
by wise_guybg
The bean they specify in the pdf is session scoped:
<managed-bean>
| <managed-bean-name>infoBean</managed-bean-name>
| <managed-bean-class>sample.InfoBean</managed-bean-class>
| <managed-bean-scope>session</managed-bean-scope>
| <managed-property>
| <property-name>skin</property-name>
| <value>classic</value>
| </managed-property>
| </managed-bean>
The expression you specify in web.xml must point to a session bean. Your user bean will not be initialized at login I suppose.
You can create a session bean and store the skin name there. As I suggested before the SkinBean can be used for that purpose too. When your user logs in, you simply set the skin name of that bean. Then you will have that:
anonymous wrote : the skin is initialized at the beginning of each request and the skin name is taken from the expression you specify in web.xml
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079864#4079864
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079864
17Â years, 1Â month