Hi,
This is first foray into Spring so please excuse my ignorance.
I am trying to use Spring to access local SLSBs from existing struts Actions. I have configured the applicationContext.xml as below
My Jndi name is as above as this is mandated by Websphere 5.3.Code:<bean id="userMgr" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean" lazy-init="true"> <property name="jndiName" value="local:ejb/ejb/UserMgr"/> <property name="businessInterface" value="com.prem.ejb.UserMgrLocal"/> </bean> <bean id="testController" class="com.prem.struts.ModuleSwitchAction"> <property name="userMgr" ref=" </bean>
In my Web.xml i have the
Code:<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
In my struts action ModuleSwitchAction i have the following:
My question:Code:private com.prem.ejb.UserMgrLocal userMgr; public void setUserMgr(UserMgrLocal userMgr) { this.userMgr = userMgr; }
Will Spring set the UserMgrLocal object only when the applicationContext is first parsed (on application startup) or will it do it everytime my StrutsAction is created?
I have added logging to the setUserMgr method and noticed that this is only being called when the application is first started.
Is there a way to make spring invoke this setter everytime the object is constructed?
Thanks in Advance
Prem


Reply With Quote