struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cook" <>
Subject RE: Struts 2 Spring Plugin Usage
Date Mon, 02 Nov 2009 16:24:49 GMT
Hey Roger,

If I am understanding you then that is fine.

I often do the same, as I like to have a DAO as well as a Service layer.
So inject my DAO's into my Service and my Service into my actions.

Good ole' code by interface approach :)

-----Original Message-----
From: RogerV [] 
Sent: 02 November 2009 16:16
Subject: Struts 2 Spring Plugin Usage

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

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

and everywhere where my action classes have a setSecurityManager()
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="........"/>
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
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:

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

View raw message