struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cook" <James.C...@wecomm.com>
Subject RE: Struts 2 Spring Plugin Usage
Date Mon, 02 Nov 2009 17:25:36 GMT
That is because of the default autowiring.

I use the convention plugin for Struts and I take advantage of the
spring auto wiring (by name) to automagically inject my service layer.
You can do the same for the rest. Check out the reference guide over at
spring framework to do so. Weirdly I like having my DAO and Service
classes in the appcontext xml file.. But then that is because I am
weird...

-----Original Message-----
From: Roger Varley [mailto:roger.varley@googlemail.com] 
Sent: 02 November 2009 17:22
To: Struts Users Mailing List
Subject: Re: Struts 2 Spring Plugin Usage

>
> 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 :)
>

It's the means that I have to employ to go down the next level I was
questioning. Whereas the action gets injected with a simple <bean
id="securityManager" class="com.myApp.security.PasswordChecker" />, I
have to use the longer version <bean id="securityManager"
       class="com.myApp.security.PasswordChecker">
       <property name="service"><ref local="Service"/>
       </property>
</bean>
to get things injected into my bean. I was wondering why just
declaring the service bean in the same way as the SecurityManager
doesn't seem to work.

Mind you, it's nice to know my design approach isn't totally AWOL as
well.

Regards

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


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


Mime
View raw message