In Mannings "Struts 2 in Action" there's an example of Spring
setter-injection by simply specifying the bean to be injected with a basic
applicationContext.xml like;

<beans>
<bean id="securityManager" class="com.myApp.security.PasswordChecker" />
</beans>

and everywhere where my action classes have a setSecurityManager() method
the PasswordChecker is injected. This works brilliantly. 

However how far down the "tree" can I go with this simple approach? For
example, the securityManager in turn has a setService(Service service)
method, and defining an additional <bean id="service" class="........"/> is
not working as expected - the injection is not happening whereas 

<bean id="securityManager"
        class="com.myApp.security.PasswordChecker">
        <property name="service"><ref local="Service"/>
        </property>
</bean>

<bean id="Service" class="com.myApp.services.ServicesImpl"/> 

injects the SecurityManager with the service and then injects the
SecurityManager into my Action. Have I missed something or is this working
as it should and I'm misunderstanding the book?

Regards
-- 
View this message in context: 
http://old.nabble.com/Struts-2-Spring-Plugin-Usage-tp26157722p26157722.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to