struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Néstor Boscán <nesto...@gmail.com>
Subject RE: Is there a way to use Spring to inject objects to a Struts 2 Interceptor?
Date Mon, 07 Jan 2008 18:31:43 GMT
Ted it looks like Struts 2 does use the object factory for the Interceptor.
I already wired the Interceptor with Spring.

Thanks Alot!! 

-----Mensaje original-----
De: ted.husted@gmail.com [mailto:ted.husted@gmail.com] En nombre de Ted
Husted
Enviado el: Lunes, 07 de Enero de 2008 12:46 p.m.
Para: Néstor Boscán
Asunto: Re: Is there a way to use Spring to inject objects to a Struts 2
Interceptor?

The Struts2 Spring plugin takes care of that for the Actions. I just don't
know if the object factory is also used with Intecepter properties.

 * http://struts.apache.org/2.x/docs/spring-plugin.html

If it doesn't, depending on the use case, an alternative might be to inject
the properties into the Action, and then have the Interceptor use the Action
property.

HTH, Ted
 * <http://www.StrutsMentor.com/>


On Jan 7, 2008 11:22 AM, Néstor Boscán <nestorjb@gmail.com> wrote:
> No I haven't tried that because how Struts knows that the interceptor 
> that I'm defining is instantiated by Spring and not by Struts 2?
>
> -----Mensaje original-----
> De: ted.husted@gmail.com [mailto:ted.husted@gmail.com] En nombre de 
> Ted Husted Enviado el: Lunes, 07 de Enero de 2008 09:24 a.m.
> Para: Struts Users Mailing List
> CC: nestorjb@gmail.com
> Asunto: Re: Is there a way to use Spring to inject objects to a Struts 
> 2
>
> Interceptor?
>
> Hmmm, it's an interesting idea.
>
> I take it you already tried defining a property in the Interceptor, 
> the same way we would for an Action, and a Spring bean was not 
> injected into the Interceptor property? (I never tried it myself.)
>
> -- HTH, Ted
>  * <http://www.StrutsMentor.com/>
>
> On Jan 4, 2008 4:51 PM, Néstor Boscán <nestorjb@gmail.com> wrote:
> > Hi
> >
> > Is there a way to use Spring to inject objects to a Struts 2
Interceptor?
> >
> > Regards,
> >
> > Néstor Boscán
>
>


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


Mime
View raw message