struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RogerV <>
Subject Struts 2 Spring Plugin Usage
Date Mon, 02 Nov 2009 16:16:16 GMT

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;

<bean id="securityManager" class="" />

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"
	<property name="service"><ref local="Service"/>

<bean id="Service" class=""/> 

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?

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message