You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Baranski <li...@secmgmt.com> on 2009/09/23 16:21:18 UTC

Interceptor IOC with Spring

Correct me if I'm wrong, please, but if I have an interceptor, it should get
injected by spring.

I have a bean I'm expecting, the set method written, and the bean defined in
applicationContext.

My main struts.xml has:

<constant name="struts.objectFactory"
value="org.apache.struts2.spring.StrutsSpringObjectFactory" />

My setter is not getting called, is there anything else I need to do?


M.


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


RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
Wow, thanks Chris, you're right.  Changing to baseAction as the bean name
and setBaseAction as the method name fixed it...

Strange, as I have other beans like that with funky names...

>-----Original Message-----
>From: Chris Pratt [mailto:thechrispratt@gmail.com]
>Sent: Thursday, September 24, 2009 12:19 PM
>To: Struts Users Mailing List
>Subject: Re: Interceptor IOC with Spring
>
>If you have working examples in the same application, there must be
>something different about this instance.
>
>Could it be the bean name?  I've been occasionally baffled by what you
>have
>to do with strangely cased bean names.  I've particularly had trouble
>when
>one of the automatically cased characters butts up against an uppercase
>character (like ID, should it be iD, ID, id... depends on the system).
>
>As a test, I'd define a second bean with a more typical name, referring
>to
>the same class and add a mutator for it to your interceptor.  See if
>that
>one gets injected, but not the original.
>  (*Chris*)
>
>On Thu, Sep 24, 2009 at 8:54 AM, Mike Baranski <
>list-subscriptions@secmgmt.com> wrote:
>
>> Yes, and my other interceptor has my data source injected, and it's
>setup
>> the same way...
>>
>> >-----Original Message-----
>> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> >Sent: Thursday, September 24, 2009 11:51 AM
>> >To: Struts Users Mailing List
>> >Subject: Re: Interceptor IOC with Spring
>> >
>> >The only other difference I can see between my (working) example and
>> >yours
>> >is that I used the shortcut
>> >
>> ><constant name="struts.objectFactory" value="spring" />
>> >
>> >I don't know if there's a difference under the covers or not.
>> >
>> >Also, is the intercept method of your interceptor being called?
>> >  (*Chris*)
>> >
>> >On Thu, Sep 24, 2009 at 8:45 AM, Mike Baranski <
>> >list-subscriptions@secmgmt.com> wrote:
>> >
>> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >>       xmlns:util="http://www.springframework.org/schema/util"
>> >>
>xsi:schemaLocation="http://www.springframework.org/schema/beans
>> >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> >> http://www.springframework.org/schema/util
>> >> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>> >> default-autowire="byName">
>> >>
>> >> >-----Original Message-----
>> >> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> >> >Sent: Thursday, September 24, 2009 11:29 AM
>> >> >To: Struts Users Mailing List
>> >> >Subject: Re: Interceptor IOC with Spring
>> >> >
>> >> >What do you have default-autowire set to in your
>> >applicationContext.xml?
>> >> >  (*Chris*)
>> >> >
>> >> >On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
>> >> >list-subscriptions@secmgmt.com> wrote:
>> >> >
>> >> >> OK, I'm stuck.
>> >> >>
>> >> >> applicationContext.xml (snipped):
>> >> >> <bean id="sMCBaseAction"
>> >> >class="com.secmgmt.struts2.base.SMCBaseAction">
>> >> >> </bean>
>> >> >>
>> >> >> struts.xml (snipped):
>> >> >> <constant name="struts.objectFactory"
>> >> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >> >>
>> >> >> <interceptor-stack name="validationWorkflowStack">
>> >> >>                                <interceptor-ref
>> >> >name="redirectMessage"/>
>> >> >>                                <interceptor-ref name="prepare"/>
>> >> >>                                <interceptor-ref
>name="basicStack"/>
>> >> >>                                <interceptor-ref
>name="validation"/>
>> >> >>                                <interceptor-ref
>> >> >name="operatorHistory"/>
>> >> >>                                <interceptor-ref
>> >> >name="passwordExpired"/>
>> >> >>                                <interceptor-ref
>name="workflow"/>
>> >> >> </interceptor-stack>
>> >> >> <default-interceptor-ref name="validationWorkflowStack" />
>> >> >>
>> >> >> PasswordExpiredInterceptor method:
>> >> >> public void setSMCBaseAction(SMCBaseAction b) throws Exception
>> >> >>        {
>> >> >>            this.action = b;
>> >> >>            l.debug("Calling setSMCBaseAction with: " + b);
>> >> >>            this.initMe();
>> >> >>        }
>> >> >>
>> >> >> Actions (and my operatorHistory) interceptor have *other* beans
>> >> >injected
>> >> >> just fine.  Can someone point out where I'm going wrong (I'm
>sure
>> >it's
>> >> >> something stupid).
>> >> >>
>> >> >> Thanks!
>> >> >>
>> >> >> >-----Original Message-----
>> >> >> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
>> >> >> >Sent: Wednesday, September 23, 2009 2:17 PM
>> >> >> >To: 'Struts Users Mailing List'
>> >> >> >Subject: RE: Interceptor IOC with Spring
>> >> >> >
>> >> >> >Doh!  Sorry for the goose chase, I'll review my code and post
>it
>> >if
>> >> >I'm
>> >> >> >still stuck...
>> >> >> >
>> >> >> >>-----Original Message-----
>> >> >> >>From: Musachy Barroso [mailto:musachy@gmail.com]
>> >> >> >>Sent: Wednesday, September 23, 2009 1:59 PM
>> >> >> >>To: Struts Users Mailing List
>> >> >> >>Subject: Re: Interceptor IOC with Spring
>> >> >> >>
>> >> >> >>Meh, it all works. Autorired with/without annotations and
>> >@Resource
>> >> >> >>also works (in interceptors). @OP, something is wrong in your
>> >> >> >>configuration, show us the code :)
>> >> >> >>
>> >> >> >>musachy
>> >> >> >>
>> >> >> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
>> >> ><mu...@gmail.com>
>> >> >> >>wrote:
>> >> >> >>> Chris, if autowiring works then using @Autowire with
>@Qualifier
>> >> >> >>> (equivalent to @Resource) should also work, I have to try
>that.
>> >> >> >>>
>> >> >> >>> musachy
>> >> >> >>>
>> >> >> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
>> >> >> ><th...@gmail.com>
>> >> >> >>wrote:
>> >> >> >>>> In my struts.xml I have:
>> >> >> >>>>
>> >> >> >>>>  <constant name="struts.objectFactory" value="spring"/>
>> >> >> >>>>
>> >> >> >>>> And at the top of my applicationContext.xml I have:
>> >> >> >>>>
>> >> >> >>>> <beans default-autowire="autodetect" xmlns=...>
>> >> >> >>>>
>> >> >> >>>> And my Interceptors are getting injected just fine.  On
>> >another
>> >> >> >>project, I
>> >> >> >>>> have autowiring turned off, but then you have to define
>each
>> >> >> >>interceptor as
>> >> >> >>>> a bean in the applicationContext.xml and specifically
>define
>> >the
>> >> >> >>objects
>> >> >> >>>> that get injected into it.
>> >> >> >>>>  (*Chris*)
>> >> >> >>>>
>> >> >> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> >> >> >>>> list-subscriptions@secmgmt.com> wrote:
>> >> >> >>>>
>> >> >> >>>>> Correct me if I'm wrong, please, but if I have an
>> >interceptor,
>> >> >it
>> >> >> >>should
>> >> >> >>>>> get
>> >> >> >>>>> injected by spring.
>> >> >> >>>>>
>> >> >> >>>>> I have a bean I'm expecting, the set method written, and
>the
>> >> >bean
>> >> >> >>defined
>> >> >> >>>>> in
>> >> >> >>>>> applicationContext.
>> >> >> >>>>>
>> >> >> >>>>> My main struts.xml has:
>> >> >> >>>>>
>> >> >> >>>>> <constant name="struts.objectFactory"
>> >> >> >>>>>
>value="org.apache.struts2.spring.StrutsSpringObjectFactory"
>> >/>
>> >> >> >>>>>
>> >> >> >>>>> My setter is not getting called, is there anything else I
>> >need
>> >> >to
>> >> >> >>do?
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>> M.
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>> ----------------------------------------------------------
>---
>> >---
>> >> >---
>> >> >> >-
>> >> >> >>-
>> >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> >>>>> For additional commands, e-mail: user-
>help@struts.apache.org
>> >> >> >>>>>
>> >> >> >>>>>
>> >> >> >>>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> --
>> >> >> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >> >>>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>--
>> >> >> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >> >>
>> >> >> >>--------------------------------------------------------------
>---
>> >---
>> >> >-
>> >> >> >>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
>> >> >>
>> >> >>
>> >> >> ----------------------------------------------------------------
>---
>> >--
>> >> >> 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
>> >>
>> >>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Interceptor IOC with Spring

Posted by Chris Pratt <th...@gmail.com>.
If you have working examples in the same application, there must be
something different about this instance.

Could it be the bean name?  I've been occasionally baffled by what you have
to do with strangely cased bean names.  I've particularly had trouble when
one of the automatically cased characters butts up against an uppercase
character (like ID, should it be iD, ID, id... depends on the system).

As a test, I'd define a second bean with a more typical name, referring to
the same class and add a mutator for it to your interceptor.  See if that
one gets injected, but not the original.
  (*Chris*)

On Thu, Sep 24, 2009 at 8:54 AM, Mike Baranski <
list-subscriptions@secmgmt.com> wrote:

> Yes, and my other interceptor has my data source injected, and it's setup
> the same way...
>
> >-----Original Message-----
> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
> >Sent: Thursday, September 24, 2009 11:51 AM
> >To: Struts Users Mailing List
> >Subject: Re: Interceptor IOC with Spring
> >
> >The only other difference I can see between my (working) example and
> >yours
> >is that I used the shortcut
> >
> ><constant name="struts.objectFactory" value="spring" />
> >
> >I don't know if there's a difference under the covers or not.
> >
> >Also, is the intercept method of your interceptor being called?
> >  (*Chris*)
> >
> >On Thu, Sep 24, 2009 at 8:45 AM, Mike Baranski <
> >list-subscriptions@secmgmt.com> wrote:
> >
> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>       xmlns:util="http://www.springframework.org/schema/util"
> >>       xsi:schemaLocation="http://www.springframework.org/schema/beans
> >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> >> http://www.springframework.org/schema/util
> >> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
> >> default-autowire="byName">
> >>
> >> >-----Original Message-----
> >> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
> >> >Sent: Thursday, September 24, 2009 11:29 AM
> >> >To: Struts Users Mailing List
> >> >Subject: Re: Interceptor IOC with Spring
> >> >
> >> >What do you have default-autowire set to in your
> >applicationContext.xml?
> >> >  (*Chris*)
> >> >
> >> >On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
> >> >list-subscriptions@secmgmt.com> wrote:
> >> >
> >> >> OK, I'm stuck.
> >> >>
> >> >> applicationContext.xml (snipped):
> >> >> <bean id="sMCBaseAction"
> >> >class="com.secmgmt.struts2.base.SMCBaseAction">
> >> >> </bean>
> >> >>
> >> >> struts.xml (snipped):
> >> >> <constant name="struts.objectFactory"
> >> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >> >>
> >> >> <interceptor-stack name="validationWorkflowStack">
> >> >>                                <interceptor-ref
> >> >name="redirectMessage"/>
> >> >>                                <interceptor-ref name="prepare"/>
> >> >>                                <interceptor-ref name="basicStack"/>
> >> >>                                <interceptor-ref name="validation"/>
> >> >>                                <interceptor-ref
> >> >name="operatorHistory"/>
> >> >>                                <interceptor-ref
> >> >name="passwordExpired"/>
> >> >>                                <interceptor-ref name="workflow"/>
> >> >> </interceptor-stack>
> >> >> <default-interceptor-ref name="validationWorkflowStack" />
> >> >>
> >> >> PasswordExpiredInterceptor method:
> >> >> public void setSMCBaseAction(SMCBaseAction b) throws Exception
> >> >>        {
> >> >>            this.action = b;
> >> >>            l.debug("Calling setSMCBaseAction with: " + b);
> >> >>            this.initMe();
> >> >>        }
> >> >>
> >> >> Actions (and my operatorHistory) interceptor have *other* beans
> >> >injected
> >> >> just fine.  Can someone point out where I'm going wrong (I'm sure
> >it's
> >> >> something stupid).
> >> >>
> >> >> Thanks!
> >> >>
> >> >> >-----Original Message-----
> >> >> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
> >> >> >Sent: Wednesday, September 23, 2009 2:17 PM
> >> >> >To: 'Struts Users Mailing List'
> >> >> >Subject: RE: Interceptor IOC with Spring
> >> >> >
> >> >> >Doh!  Sorry for the goose chase, I'll review my code and post it
> >if
> >> >I'm
> >> >> >still stuck...
> >> >> >
> >> >> >>-----Original Message-----
> >> >> >>From: Musachy Barroso [mailto:musachy@gmail.com]
> >> >> >>Sent: Wednesday, September 23, 2009 1:59 PM
> >> >> >>To: Struts Users Mailing List
> >> >> >>Subject: Re: Interceptor IOC with Spring
> >> >> >>
> >> >> >>Meh, it all works. Autorired with/without annotations and
> >@Resource
> >> >> >>also works (in interceptors). @OP, something is wrong in your
> >> >> >>configuration, show us the code :)
> >> >> >>
> >> >> >>musachy
> >> >> >>
> >> >> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
> >> ><mu...@gmail.com>
> >> >> >>wrote:
> >> >> >>> Chris, if autowiring works then using @Autowire with @Qualifier
> >> >> >>> (equivalent to @Resource) should also work, I have to try that.
> >> >> >>>
> >> >> >>> musachy
> >> >> >>>
> >> >> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
> >> >> ><th...@gmail.com>
> >> >> >>wrote:
> >> >> >>>> In my struts.xml I have:
> >> >> >>>>
> >> >> >>>>  <constant name="struts.objectFactory" value="spring"/>
> >> >> >>>>
> >> >> >>>> And at the top of my applicationContext.xml I have:
> >> >> >>>>
> >> >> >>>> <beans default-autowire="autodetect" xmlns=...>
> >> >> >>>>
> >> >> >>>> And my Interceptors are getting injected just fine.  On
> >another
> >> >> >>project, I
> >> >> >>>> have autowiring turned off, but then you have to define each
> >> >> >>interceptor as
> >> >> >>>> a bean in the applicationContext.xml and specifically define
> >the
> >> >> >>objects
> >> >> >>>> that get injected into it.
> >> >> >>>>  (*Chris*)
> >> >> >>>>
> >> >> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> >> >> >>>> list-subscriptions@secmgmt.com> wrote:
> >> >> >>>>
> >> >> >>>>> Correct me if I'm wrong, please, but if I have an
> >interceptor,
> >> >it
> >> >> >>should
> >> >> >>>>> get
> >> >> >>>>> injected by spring.
> >> >> >>>>>
> >> >> >>>>> I have a bean I'm expecting, the set method written, and the
> >> >bean
> >> >> >>defined
> >> >> >>>>> in
> >> >> >>>>> applicationContext.
> >> >> >>>>>
> >> >> >>>>> My main struts.xml has:
> >> >> >>>>>
> >> >> >>>>> <constant name="struts.objectFactory"
> >> >> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory"
> >/>
> >> >> >>>>>
> >> >> >>>>> My setter is not getting called, is there anything else I
> >need
> >> >to
> >> >> >>do?
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>> M.
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>> -------------------------------------------------------------
> >---
> >> >---
> >> >> >-
> >> >> >>-
> >> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> --
> >> >> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>--
> >> >> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >> >>
> >> >> >>-----------------------------------------------------------------
> >---
> >> >-
> >> >> >>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
> >> >>
> >> >>
> >> >> -------------------------------------------------------------------
> >--
> >> >> 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
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
Yes, and my other interceptor has my data source injected, and it's setup
the same way...

>-----Original Message-----
>From: Chris Pratt [mailto:thechrispratt@gmail.com]
>Sent: Thursday, September 24, 2009 11:51 AM
>To: Struts Users Mailing List
>Subject: Re: Interceptor IOC with Spring
>
>The only other difference I can see between my (working) example and
>yours
>is that I used the shortcut
>
><constant name="struts.objectFactory" value="spring" />
>
>I don't know if there's a difference under the covers or not.
>
>Also, is the intercept method of your interceptor being called?
>  (*Chris*)
>
>On Thu, Sep 24, 2009 at 8:45 AM, Mike Baranski <
>list-subscriptions@secmgmt.com> wrote:
>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:util="http://www.springframework.org/schema/util"
>>       xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>> default-autowire="byName">
>>
>> >-----Original Message-----
>> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> >Sent: Thursday, September 24, 2009 11:29 AM
>> >To: Struts Users Mailing List
>> >Subject: Re: Interceptor IOC with Spring
>> >
>> >What do you have default-autowire set to in your
>applicationContext.xml?
>> >  (*Chris*)
>> >
>> >On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
>> >list-subscriptions@secmgmt.com> wrote:
>> >
>> >> OK, I'm stuck.
>> >>
>> >> applicationContext.xml (snipped):
>> >> <bean id="sMCBaseAction"
>> >class="com.secmgmt.struts2.base.SMCBaseAction">
>> >> </bean>
>> >>
>> >> struts.xml (snipped):
>> >> <constant name="struts.objectFactory"
>> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >>
>> >> <interceptor-stack name="validationWorkflowStack">
>> >>                                <interceptor-ref
>> >name="redirectMessage"/>
>> >>                                <interceptor-ref name="prepare"/>
>> >>                                <interceptor-ref name="basicStack"/>
>> >>                                <interceptor-ref name="validation"/>
>> >>                                <interceptor-ref
>> >name="operatorHistory"/>
>> >>                                <interceptor-ref
>> >name="passwordExpired"/>
>> >>                                <interceptor-ref name="workflow"/>
>> >> </interceptor-stack>
>> >> <default-interceptor-ref name="validationWorkflowStack" />
>> >>
>> >> PasswordExpiredInterceptor method:
>> >> public void setSMCBaseAction(SMCBaseAction b) throws Exception
>> >>        {
>> >>            this.action = b;
>> >>            l.debug("Calling setSMCBaseAction with: " + b);
>> >>            this.initMe();
>> >>        }
>> >>
>> >> Actions (and my operatorHistory) interceptor have *other* beans
>> >injected
>> >> just fine.  Can someone point out where I'm going wrong (I'm sure
>it's
>> >> something stupid).
>> >>
>> >> Thanks!
>> >>
>> >> >-----Original Message-----
>> >> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
>> >> >Sent: Wednesday, September 23, 2009 2:17 PM
>> >> >To: 'Struts Users Mailing List'
>> >> >Subject: RE: Interceptor IOC with Spring
>> >> >
>> >> >Doh!  Sorry for the goose chase, I'll review my code and post it
>if
>> >I'm
>> >> >still stuck...
>> >> >
>> >> >>-----Original Message-----
>> >> >>From: Musachy Barroso [mailto:musachy@gmail.com]
>> >> >>Sent: Wednesday, September 23, 2009 1:59 PM
>> >> >>To: Struts Users Mailing List
>> >> >>Subject: Re: Interceptor IOC with Spring
>> >> >>
>> >> >>Meh, it all works. Autorired with/without annotations and
>@Resource
>> >> >>also works (in interceptors). @OP, something is wrong in your
>> >> >>configuration, show us the code :)
>> >> >>
>> >> >>musachy
>> >> >>
>> >> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
>> ><mu...@gmail.com>
>> >> >>wrote:
>> >> >>> Chris, if autowiring works then using @Autowire with @Qualifier
>> >> >>> (equivalent to @Resource) should also work, I have to try that.
>> >> >>>
>> >> >>> musachy
>> >> >>>
>> >> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
>> >> ><th...@gmail.com>
>> >> >>wrote:
>> >> >>>> In my struts.xml I have:
>> >> >>>>
>> >> >>>>  <constant name="struts.objectFactory" value="spring"/>
>> >> >>>>
>> >> >>>> And at the top of my applicationContext.xml I have:
>> >> >>>>
>> >> >>>> <beans default-autowire="autodetect" xmlns=...>
>> >> >>>>
>> >> >>>> And my Interceptors are getting injected just fine.  On
>another
>> >> >>project, I
>> >> >>>> have autowiring turned off, but then you have to define each
>> >> >>interceptor as
>> >> >>>> a bean in the applicationContext.xml and specifically define
>the
>> >> >>objects
>> >> >>>> that get injected into it.
>> >> >>>>  (*Chris*)
>> >> >>>>
>> >> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> >> >>>> list-subscriptions@secmgmt.com> wrote:
>> >> >>>>
>> >> >>>>> Correct me if I'm wrong, please, but if I have an
>interceptor,
>> >it
>> >> >>should
>> >> >>>>> get
>> >> >>>>> injected by spring.
>> >> >>>>>
>> >> >>>>> I have a bean I'm expecting, the set method written, and the
>> >bean
>> >> >>defined
>> >> >>>>> in
>> >> >>>>> applicationContext.
>> >> >>>>>
>> >> >>>>> My main struts.xml has:
>> >> >>>>>
>> >> >>>>> <constant name="struts.objectFactory"
>> >> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory"
>/>
>> >> >>>>>
>> >> >>>>> My setter is not getting called, is there anything else I
>need
>> >to
>> >> >>do?
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> M.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> -------------------------------------------------------------
>---
>> >---
>> >> >-
>> >> >>-
>> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >>>
>> >> >>
>> >> >>
>> >> >>
>> >> >>--
>> >> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >>
>> >> >>-----------------------------------------------------------------
>---
>> >-
>> >> >>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
>> >>
>> >>
>> >> -------------------------------------------------------------------
>--
>> >> 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
>>
>>


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


Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
I am surprised it works at all. Add a @Required to that method and see
what spring complains about.

On Thu, Sep 24, 2009 at 8:51 AM, Chris Pratt <th...@gmail.com> wrote:
> The only other difference I can see between my (working) example and yours
> is that I used the shortcut
>
> <constant name="struts.objectFactory" value="spring" />
>
> I don't know if there's a difference under the covers or not.
>
> Also, is the intercept method of your interceptor being called?
>  (*Chris*)
>
> On Thu, Sep 24, 2009 at 8:45 AM, Mike Baranski <
> list-subscriptions@secmgmt.com> wrote:
>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:util="http://www.springframework.org/schema/util"
>>       xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>> default-autowire="byName">
>>
>> >-----Original Message-----
>> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> >Sent: Thursday, September 24, 2009 11:29 AM
>> >To: Struts Users Mailing List
>> >Subject: Re: Interceptor IOC with Spring
>> >
>> >What do you have default-autowire set to in your applicationContext.xml?
>> >  (*Chris*)
>> >
>> >On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
>> >list-subscriptions@secmgmt.com> wrote:
>> >
>> >> OK, I'm stuck.
>> >>
>> >> applicationContext.xml (snipped):
>> >> <bean id="sMCBaseAction"
>> >class="com.secmgmt.struts2.base.SMCBaseAction">
>> >> </bean>
>> >>
>> >> struts.xml (snipped):
>> >> <constant name="struts.objectFactory"
>> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >>
>> >> <interceptor-stack name="validationWorkflowStack">
>> >>                                <interceptor-ref
>> >name="redirectMessage"/>
>> >>                                <interceptor-ref name="prepare"/>
>> >>                                <interceptor-ref name="basicStack"/>
>> >>                                <interceptor-ref name="validation"/>
>> >>                                <interceptor-ref
>> >name="operatorHistory"/>
>> >>                                <interceptor-ref
>> >name="passwordExpired"/>
>> >>                                <interceptor-ref name="workflow"/>
>> >> </interceptor-stack>
>> >> <default-interceptor-ref name="validationWorkflowStack" />
>> >>
>> >> PasswordExpiredInterceptor method:
>> >> public void setSMCBaseAction(SMCBaseAction b) throws Exception
>> >>        {
>> >>            this.action = b;
>> >>            l.debug("Calling setSMCBaseAction with: " + b);
>> >>            this.initMe();
>> >>        }
>> >>
>> >> Actions (and my operatorHistory) interceptor have *other* beans
>> >injected
>> >> just fine.  Can someone point out where I'm going wrong (I'm sure it's
>> >> something stupid).
>> >>
>> >> Thanks!
>> >>
>> >> >-----Original Message-----
>> >> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
>> >> >Sent: Wednesday, September 23, 2009 2:17 PM
>> >> >To: 'Struts Users Mailing List'
>> >> >Subject: RE: Interceptor IOC with Spring
>> >> >
>> >> >Doh!  Sorry for the goose chase, I'll review my code and post it if
>> >I'm
>> >> >still stuck...
>> >> >
>> >> >>-----Original Message-----
>> >> >>From: Musachy Barroso [mailto:musachy@gmail.com]
>> >> >>Sent: Wednesday, September 23, 2009 1:59 PM
>> >> >>To: Struts Users Mailing List
>> >> >>Subject: Re: Interceptor IOC with Spring
>> >> >>
>> >> >>Meh, it all works. Autorired with/without annotations and @Resource
>> >> >>also works (in interceptors). @OP, something is wrong in your
>> >> >>configuration, show us the code :)
>> >> >>
>> >> >>musachy
>> >> >>
>> >> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
>> ><mu...@gmail.com>
>> >> >>wrote:
>> >> >>> Chris, if autowiring works then using @Autowire with @Qualifier
>> >> >>> (equivalent to @Resource) should also work, I have to try that.
>> >> >>>
>> >> >>> musachy
>> >> >>>
>> >> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
>> >> ><th...@gmail.com>
>> >> >>wrote:
>> >> >>>> In my struts.xml I have:
>> >> >>>>
>> >> >>>>  <constant name="struts.objectFactory" value="spring"/>
>> >> >>>>
>> >> >>>> And at the top of my applicationContext.xml I have:
>> >> >>>>
>> >> >>>> <beans default-autowire="autodetect" xmlns=...>
>> >> >>>>
>> >> >>>> And my Interceptors are getting injected just fine.  On another
>> >> >>project, I
>> >> >>>> have autowiring turned off, but then you have to define each
>> >> >>interceptor as
>> >> >>>> a bean in the applicationContext.xml and specifically define the
>> >> >>objects
>> >> >>>> that get injected into it.
>> >> >>>>  (*Chris*)
>> >> >>>>
>> >> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> >> >>>> list-subscriptions@secmgmt.com> wrote:
>> >> >>>>
>> >> >>>>> Correct me if I'm wrong, please, but if I have an interceptor,
>> >it
>> >> >>should
>> >> >>>>> get
>> >> >>>>> injected by spring.
>> >> >>>>>
>> >> >>>>> I have a bean I'm expecting, the set method written, and the
>> >bean
>> >> >>defined
>> >> >>>>> in
>> >> >>>>> applicationContext.
>> >> >>>>>
>> >> >>>>> My main struts.xml has:
>> >> >>>>>
>> >> >>>>> <constant name="struts.objectFactory"
>> >> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >> >>>>>
>> >> >>>>> My setter is not getting called, is there anything else I need
>> >to
>> >> >>do?
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> M.
>> >> >>>>>
>> >> >>>>>
>> >> >>>>> ----------------------------------------------------------------
>> >---
>> >> >-
>> >> >>-
>> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >>>
>> >> >>
>> >> >>
>> >> >>
>> >> >>--
>> >> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
>> >> >>
>> >> >>--------------------------------------------------------------------
>> >-
>> >> >>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
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Interceptor IOC with Spring

Posted by Chris Pratt <th...@gmail.com>.
The only other difference I can see between my (working) example and yours
is that I used the shortcut

<constant name="struts.objectFactory" value="spring" />

I don't know if there's a difference under the covers or not.

Also, is the intercept method of your interceptor being called?
  (*Chris*)

On Thu, Sep 24, 2009 at 8:45 AM, Mike Baranski <
list-subscriptions@secmgmt.com> wrote:

> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:util="http://www.springframework.org/schema/util"
>       xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
> default-autowire="byName">
>
> >-----Original Message-----
> >From: Chris Pratt [mailto:thechrispratt@gmail.com]
> >Sent: Thursday, September 24, 2009 11:29 AM
> >To: Struts Users Mailing List
> >Subject: Re: Interceptor IOC with Spring
> >
> >What do you have default-autowire set to in your applicationContext.xml?
> >  (*Chris*)
> >
> >On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
> >list-subscriptions@secmgmt.com> wrote:
> >
> >> OK, I'm stuck.
> >>
> >> applicationContext.xml (snipped):
> >> <bean id="sMCBaseAction"
> >class="com.secmgmt.struts2.base.SMCBaseAction">
> >> </bean>
> >>
> >> struts.xml (snipped):
> >> <constant name="struts.objectFactory"
> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >>
> >> <interceptor-stack name="validationWorkflowStack">
> >>                                <interceptor-ref
> >name="redirectMessage"/>
> >>                                <interceptor-ref name="prepare"/>
> >>                                <interceptor-ref name="basicStack"/>
> >>                                <interceptor-ref name="validation"/>
> >>                                <interceptor-ref
> >name="operatorHistory"/>
> >>                                <interceptor-ref
> >name="passwordExpired"/>
> >>                                <interceptor-ref name="workflow"/>
> >> </interceptor-stack>
> >> <default-interceptor-ref name="validationWorkflowStack" />
> >>
> >> PasswordExpiredInterceptor method:
> >> public void setSMCBaseAction(SMCBaseAction b) throws Exception
> >>        {
> >>            this.action = b;
> >>            l.debug("Calling setSMCBaseAction with: " + b);
> >>            this.initMe();
> >>        }
> >>
> >> Actions (and my operatorHistory) interceptor have *other* beans
> >injected
> >> just fine.  Can someone point out where I'm going wrong (I'm sure it's
> >> something stupid).
> >>
> >> Thanks!
> >>
> >> >-----Original Message-----
> >> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
> >> >Sent: Wednesday, September 23, 2009 2:17 PM
> >> >To: 'Struts Users Mailing List'
> >> >Subject: RE: Interceptor IOC with Spring
> >> >
> >> >Doh!  Sorry for the goose chase, I'll review my code and post it if
> >I'm
> >> >still stuck...
> >> >
> >> >>-----Original Message-----
> >> >>From: Musachy Barroso [mailto:musachy@gmail.com]
> >> >>Sent: Wednesday, September 23, 2009 1:59 PM
> >> >>To: Struts Users Mailing List
> >> >>Subject: Re: Interceptor IOC with Spring
> >> >>
> >> >>Meh, it all works. Autorired with/without annotations and @Resource
> >> >>also works (in interceptors). @OP, something is wrong in your
> >> >>configuration, show us the code :)
> >> >>
> >> >>musachy
> >> >>
> >> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
> ><mu...@gmail.com>
> >> >>wrote:
> >> >>> Chris, if autowiring works then using @Autowire with @Qualifier
> >> >>> (equivalent to @Resource) should also work, I have to try that.
> >> >>>
> >> >>> musachy
> >> >>>
> >> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
> >> ><th...@gmail.com>
> >> >>wrote:
> >> >>>> In my struts.xml I have:
> >> >>>>
> >> >>>>  <constant name="struts.objectFactory" value="spring"/>
> >> >>>>
> >> >>>> And at the top of my applicationContext.xml I have:
> >> >>>>
> >> >>>> <beans default-autowire="autodetect" xmlns=...>
> >> >>>>
> >> >>>> And my Interceptors are getting injected just fine.  On another
> >> >>project, I
> >> >>>> have autowiring turned off, but then you have to define each
> >> >>interceptor as
> >> >>>> a bean in the applicationContext.xml and specifically define the
> >> >>objects
> >> >>>> that get injected into it.
> >> >>>>  (*Chris*)
> >> >>>>
> >> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> >> >>>> list-subscriptions@secmgmt.com> wrote:
> >> >>>>
> >> >>>>> Correct me if I'm wrong, please, but if I have an interceptor,
> >it
> >> >>should
> >> >>>>> get
> >> >>>>> injected by spring.
> >> >>>>>
> >> >>>>> I have a bean I'm expecting, the set method written, and the
> >bean
> >> >>defined
> >> >>>>> in
> >> >>>>> applicationContext.
> >> >>>>>
> >> >>>>> My main struts.xml has:
> >> >>>>>
> >> >>>>> <constant name="struts.objectFactory"
> >> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >> >>>>>
> >> >>>>> My setter is not getting called, is there anything else I need
> >to
> >> >>do?
> >> >>>>>
> >> >>>>>
> >> >>>>> M.
> >> >>>>>
> >> >>>>>
> >> >>>>> ----------------------------------------------------------------
> >---
> >> >-
> >> >>-
> >> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >>>
> >> >>
> >> >>
> >> >>
> >> >>--
> >> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >>
> >> >>--------------------------------------------------------------------
> >-
> >> >>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
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd"
default-autowire="byName">

>-----Original Message-----
>From: Chris Pratt [mailto:thechrispratt@gmail.com]
>Sent: Thursday, September 24, 2009 11:29 AM
>To: Struts Users Mailing List
>Subject: Re: Interceptor IOC with Spring
>
>What do you have default-autowire set to in your applicationContext.xml?
>  (*Chris*)
>
>On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
>list-subscriptions@secmgmt.com> wrote:
>
>> OK, I'm stuck.
>>
>> applicationContext.xml (snipped):
>> <bean id="sMCBaseAction"
>class="com.secmgmt.struts2.base.SMCBaseAction">
>> </bean>
>>
>> struts.xml (snipped):
>> <constant name="struts.objectFactory"
>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>
>> <interceptor-stack name="validationWorkflowStack">
>>                                <interceptor-ref
>name="redirectMessage"/>
>>                                <interceptor-ref name="prepare"/>
>>                                <interceptor-ref name="basicStack"/>
>>                                <interceptor-ref name="validation"/>
>>                                <interceptor-ref
>name="operatorHistory"/>
>>                                <interceptor-ref
>name="passwordExpired"/>
>>                                <interceptor-ref name="workflow"/>
>> </interceptor-stack>
>> <default-interceptor-ref name="validationWorkflowStack" />
>>
>> PasswordExpiredInterceptor method:
>> public void setSMCBaseAction(SMCBaseAction b) throws Exception
>>        {
>>            this.action = b;
>>            l.debug("Calling setSMCBaseAction with: " + b);
>>            this.initMe();
>>        }
>>
>> Actions (and my operatorHistory) interceptor have *other* beans
>injected
>> just fine.  Can someone point out where I'm going wrong (I'm sure it's
>> something stupid).
>>
>> Thanks!
>>
>> >-----Original Message-----
>> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
>> >Sent: Wednesday, September 23, 2009 2:17 PM
>> >To: 'Struts Users Mailing List'
>> >Subject: RE: Interceptor IOC with Spring
>> >
>> >Doh!  Sorry for the goose chase, I'll review my code and post it if
>I'm
>> >still stuck...
>> >
>> >>-----Original Message-----
>> >>From: Musachy Barroso [mailto:musachy@gmail.com]
>> >>Sent: Wednesday, September 23, 2009 1:59 PM
>> >>To: Struts Users Mailing List
>> >>Subject: Re: Interceptor IOC with Spring
>> >>
>> >>Meh, it all works. Autorired with/without annotations and @Resource
>> >>also works (in interceptors). @OP, something is wrong in your
>> >>configuration, show us the code :)
>> >>
>> >>musachy
>> >>
>> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso
><mu...@gmail.com>
>> >>wrote:
>> >>> Chris, if autowiring works then using @Autowire with @Qualifier
>> >>> (equivalent to @Resource) should also work, I have to try that.
>> >>>
>> >>> musachy
>> >>>
>> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
>> ><th...@gmail.com>
>> >>wrote:
>> >>>> In my struts.xml I have:
>> >>>>
>> >>>>  <constant name="struts.objectFactory" value="spring"/>
>> >>>>
>> >>>> And at the top of my applicationContext.xml I have:
>> >>>>
>> >>>> <beans default-autowire="autodetect" xmlns=...>
>> >>>>
>> >>>> And my Interceptors are getting injected just fine.  On another
>> >>project, I
>> >>>> have autowiring turned off, but then you have to define each
>> >>interceptor as
>> >>>> a bean in the applicationContext.xml and specifically define the
>> >>objects
>> >>>> that get injected into it.
>> >>>>  (*Chris*)
>> >>>>
>> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> >>>> list-subscriptions@secmgmt.com> wrote:
>> >>>>
>> >>>>> Correct me if I'm wrong, please, but if I have an interceptor,
>it
>> >>should
>> >>>>> get
>> >>>>> injected by spring.
>> >>>>>
>> >>>>> I have a bean I'm expecting, the set method written, and the
>bean
>> >>defined
>> >>>>> in
>> >>>>> applicationContext.
>> >>>>>
>> >>>>> My main struts.xml has:
>> >>>>>
>> >>>>> <constant name="struts.objectFactory"
>> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >>>>>
>> >>>>> My setter is not getting called, is there anything else I need
>to
>> >>do?
>> >>>>>
>> >>>>>
>> >>>>> M.
>> >>>>>
>> >>>>>
>> >>>>> ----------------------------------------------------------------
>---
>> >-
>> >>-
>> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >>>>> For additional commands, e-mail: user-help@struts.apache.org
>> >>>>>
>> >>>>>
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >>>
>> >>
>> >>
>> >>
>> >>--
>> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
>> >>
>> >>--------------------------------------------------------------------
>-
>> >>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
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Interceptor IOC with Spring

Posted by Chris Pratt <th...@gmail.com>.
What do you have default-autowire set to in your applicationContext.xml?
  (*Chris*)

On Thu, Sep 24, 2009 at 8:08 AM, Mike Baranski <
list-subscriptions@secmgmt.com> wrote:

> OK, I'm stuck.
>
> applicationContext.xml (snipped):
> <bean id="sMCBaseAction" class="com.secmgmt.struts2.base.SMCBaseAction">
> </bean>
>
> struts.xml (snipped):
> <constant name="struts.objectFactory"
> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>
> <interceptor-stack name="validationWorkflowStack">
>                                <interceptor-ref name="redirectMessage"/>
>                                <interceptor-ref name="prepare"/>
>                                <interceptor-ref name="basicStack"/>
>                                <interceptor-ref name="validation"/>
>                                <interceptor-ref name="operatorHistory"/>
>                                <interceptor-ref name="passwordExpired"/>
>                                <interceptor-ref name="workflow"/>
> </interceptor-stack>
> <default-interceptor-ref name="validationWorkflowStack" />
>
> PasswordExpiredInterceptor method:
> public void setSMCBaseAction(SMCBaseAction b) throws Exception
>        {
>            this.action = b;
>            l.debug("Calling setSMCBaseAction with: " + b);
>            this.initMe();
>        }
>
> Actions (and my operatorHistory) interceptor have *other* beans injected
> just fine.  Can someone point out where I'm going wrong (I'm sure it's
> something stupid).
>
> Thanks!
>
> >-----Original Message-----
> >From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
> >Sent: Wednesday, September 23, 2009 2:17 PM
> >To: 'Struts Users Mailing List'
> >Subject: RE: Interceptor IOC with Spring
> >
> >Doh!  Sorry for the goose chase, I'll review my code and post it if I'm
> >still stuck...
> >
> >>-----Original Message-----
> >>From: Musachy Barroso [mailto:musachy@gmail.com]
> >>Sent: Wednesday, September 23, 2009 1:59 PM
> >>To: Struts Users Mailing List
> >>Subject: Re: Interceptor IOC with Spring
> >>
> >>Meh, it all works. Autorired with/without annotations and @Resource
> >>also works (in interceptors). @OP, something is wrong in your
> >>configuration, show us the code :)
> >>
> >>musachy
> >>
> >>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso <mu...@gmail.com>
> >>wrote:
> >>> Chris, if autowiring works then using @Autowire with @Qualifier
> >>> (equivalent to @Resource) should also work, I have to try that.
> >>>
> >>> musachy
> >>>
> >>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
> ><th...@gmail.com>
> >>wrote:
> >>>> In my struts.xml I have:
> >>>>
> >>>>  <constant name="struts.objectFactory" value="spring"/>
> >>>>
> >>>> And at the top of my applicationContext.xml I have:
> >>>>
> >>>> <beans default-autowire="autodetect" xmlns=...>
> >>>>
> >>>> And my Interceptors are getting injected just fine.  On another
> >>project, I
> >>>> have autowiring turned off, but then you have to define each
> >>interceptor as
> >>>> a bean in the applicationContext.xml and specifically define the
> >>objects
> >>>> that get injected into it.
> >>>>  (*Chris*)
> >>>>
> >>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> >>>> list-subscriptions@secmgmt.com> wrote:
> >>>>
> >>>>> Correct me if I'm wrong, please, but if I have an interceptor, it
> >>should
> >>>>> get
> >>>>> injected by spring.
> >>>>>
> >>>>> I have a bean I'm expecting, the set method written, and the bean
> >>defined
> >>>>> in
> >>>>> applicationContext.
> >>>>>
> >>>>> My main struts.xml has:
> >>>>>
> >>>>> <constant name="struts.objectFactory"
> >>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >>>>>
> >>>>> My setter is not getting called, is there anything else I need to
> >>do?
> >>>>>
> >>>>>
> >>>>> M.
> >>>>>
> >>>>>
> >>>>> -------------------------------------------------------------------
> >-
> >>-
> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>>
> >>
> >>
> >>
> >>--
> >>"Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >>---------------------------------------------------------------------
> >>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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
OK, I'm stuck.

applicationContext.xml (snipped):
<bean id="sMCBaseAction" class="com.secmgmt.struts2.base.SMCBaseAction">
</bean>

struts.xml (snipped):
<constant name="struts.objectFactory"
value="org.apache.struts2.spring.StrutsSpringObjectFactory" />

<interceptor-stack name="validationWorkflowStack">
				<interceptor-ref name="redirectMessage"/>
				<interceptor-ref name="prepare"/>
				<interceptor-ref name="basicStack"/>
				<interceptor-ref name="validation"/>
				<interceptor-ref name="operatorHistory"/>
				<interceptor-ref name="passwordExpired"/>
				<interceptor-ref name="workflow"/>
</interceptor-stack>
<default-interceptor-ref name="validationWorkflowStack" />

PasswordExpiredInterceptor method:
public void setSMCBaseAction(SMCBaseAction b) throws Exception
        {
            this.action = b;
            l.debug("Calling setSMCBaseAction with: " + b);
            this.initMe();
        }

Actions (and my operatorHistory) interceptor have *other* beans injected
just fine.  Can someone point out where I'm going wrong (I'm sure it's
something stupid).

Thanks!

>-----Original Message-----
>From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
>Sent: Wednesday, September 23, 2009 2:17 PM
>To: 'Struts Users Mailing List'
>Subject: RE: Interceptor IOC with Spring
>
>Doh!  Sorry for the goose chase, I'll review my code and post it if I'm
>still stuck...
>
>>-----Original Message-----
>>From: Musachy Barroso [mailto:musachy@gmail.com]
>>Sent: Wednesday, September 23, 2009 1:59 PM
>>To: Struts Users Mailing List
>>Subject: Re: Interceptor IOC with Spring
>>
>>Meh, it all works. Autorired with/without annotations and @Resource
>>also works (in interceptors). @OP, something is wrong in your
>>configuration, show us the code :)
>>
>>musachy
>>
>>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso <mu...@gmail.com>
>>wrote:
>>> Chris, if autowiring works then using @Autowire with @Qualifier
>>> (equivalent to @Resource) should also work, I have to try that.
>>>
>>> musachy
>>>
>>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt
><th...@gmail.com>
>>wrote:
>>>> In my struts.xml I have:
>>>>
>>>>  <constant name="struts.objectFactory" value="spring"/>
>>>>
>>>> And at the top of my applicationContext.xml I have:
>>>>
>>>> <beans default-autowire="autodetect" xmlns=...>
>>>>
>>>> And my Interceptors are getting injected just fine.  On another
>>project, I
>>>> have autowiring turned off, but then you have to define each
>>interceptor as
>>>> a bean in the applicationContext.xml and specifically define the
>>objects
>>>> that get injected into it.
>>>>  (*Chris*)
>>>>
>>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>>>> list-subscriptions@secmgmt.com> wrote:
>>>>
>>>>> Correct me if I'm wrong, please, but if I have an interceptor, it
>>should
>>>>> get
>>>>> injected by spring.
>>>>>
>>>>> I have a bean I'm expecting, the set method written, and the bean
>>defined
>>>>> in
>>>>> applicationContext.
>>>>>
>>>>> My main struts.xml has:
>>>>>
>>>>> <constant name="struts.objectFactory"
>>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>>>>
>>>>> My setter is not getting called, is there anything else I need to
>>do?
>>>>>
>>>>>
>>>>> M.
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------
>-
>>-
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>
>>
>>
>>
>>--
>>"Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>>---------------------------------------------------------------------
>>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


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


RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
Doh!  Sorry for the goose chase, I'll review my code and post it if I'm
still stuck...

>-----Original Message-----
>From: Musachy Barroso [mailto:musachy@gmail.com]
>Sent: Wednesday, September 23, 2009 1:59 PM
>To: Struts Users Mailing List
>Subject: Re: Interceptor IOC with Spring
>
>Meh, it all works. Autorired with/without annotations and @Resource
>also works (in interceptors). @OP, something is wrong in your
>configuration, show us the code :)
>
>musachy
>
>On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso <mu...@gmail.com>
>wrote:
>> Chris, if autowiring works then using @Autowire with @Qualifier
>> (equivalent to @Resource) should also work, I have to try that.
>>
>> musachy
>>
>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com>
>wrote:
>>> In my struts.xml I have:
>>>
>>>  <constant name="struts.objectFactory" value="spring"/>
>>>
>>> And at the top of my applicationContext.xml I have:
>>>
>>> <beans default-autowire="autodetect" xmlns=...>
>>>
>>> And my Interceptors are getting injected just fine.  On another
>project, I
>>> have autowiring turned off, but then you have to define each
>interceptor as
>>> a bean in the applicationContext.xml and specifically define the
>objects
>>> that get injected into it.
>>>  (*Chris*)
>>>
>>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>>> list-subscriptions@secmgmt.com> wrote:
>>>
>>>> Correct me if I'm wrong, please, but if I have an interceptor, it
>should
>>>> get
>>>> injected by spring.
>>>>
>>>> I have a bean I'm expecting, the set method written, and the bean
>defined
>>>> in
>>>> applicationContext.
>>>>
>>>> My main struts.xml has:
>>>>
>>>> <constant name="struts.objectFactory"
>>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>>>
>>>> My setter is not getting called, is there anything else I need to
>do?
>>>>
>>>>
>>>> M.
>>>>
>>>>
>>>> --------------------------------------------------------------------
>-
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
>--
>"Hey you! Would you help me to carry the stone?" Pink Floyd
>
>---------------------------------------------------------------------
>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


Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
Meh, it all works. Autorired with/without annotations and @Resource
also works (in interceptors). @OP, something is wrong in your
configuration, show us the code :)

musachy

On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso <mu...@gmail.com> wrote:
> Chris, if autowiring works then using @Autowire with @Qualifier
> (equivalent to @Resource) should also work, I have to try that.
>
> musachy
>
> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com> wrote:
>> In my struts.xml I have:
>>
>>  <constant name="struts.objectFactory" value="spring"/>
>>
>> And at the top of my applicationContext.xml I have:
>>
>> <beans default-autowire="autodetect" xmlns=...>
>>
>> And my Interceptors are getting injected just fine.  On another project, I
>> have autowiring turned off, but then you have to define each interceptor as
>> a bean in the applicationContext.xml and specifically define the objects
>> that get injected into it.
>>  (*Chris*)
>>
>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> list-subscriptions@secmgmt.com> wrote:
>>
>>> Correct me if I'm wrong, please, but if I have an interceptor, it should
>>> get
>>> injected by spring.
>>>
>>> I have a bean I'm expecting, the set method written, and the bean defined
>>> in
>>> applicationContext.
>>>
>>> My main struts.xml has:
>>>
>>> <constant name="struts.objectFactory"
>>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>>
>>> My setter is not getting called, is there anything else I need to do?
>>>
>>>
>>> M.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
Chris, if autowiring works then using @Autowire with @Qualifier
(equivalent to @Resource) should also work, I have to try that.

musachy

On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com> wrote:
> In my struts.xml I have:
>
>  <constant name="struts.objectFactory" value="spring"/>
>
> And at the top of my applicationContext.xml I have:
>
> <beans default-autowire="autodetect" xmlns=...>
>
> And my Interceptors are getting injected just fine.  On another project, I
> have autowiring turned off, but then you have to define each interceptor as
> a bean in the applicationContext.xml and specifically define the objects
> that get injected into it.
>  (*Chris*)
>
> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> list-subscriptions@secmgmt.com> wrote:
>
>> Correct me if I'm wrong, please, but if I have an interceptor, it should
>> get
>> injected by spring.
>>
>> I have a bean I'm expecting, the set method written, and the bean defined
>> in
>> applicationContext.
>>
>> My main struts.xml has:
>>
>> <constant name="struts.objectFactory"
>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>
>> My setter is not getting called, is there anything else I need to do?
>>
>>
>> M.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Interceptor IOC with Spring

Posted by Wes Wannemacher <we...@wantii.com>.
Martin,
Good find, but I am not sure if I

understand how that

relates to the OP question or musachy's

answer
nevermind

i think you are confused which interceptors we are
dealing with
if you take a closer look at the
original poster's question you'll see that this
thread is about struts interceptors (not spring)

-Wes

On Wed, Sep 23, 2009 at 1:06 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> what you said originally about Interceptors being built only with Struts specific org.apache.struts2.impl.StrutsObjectFactory
> (and not spring's StrutsSpringObjectFactory and not StrutsSpringObjectFactory) is true
>
> Spring does handle injected interceptors via setInterceptorNames of ProxyFactoryBean
> http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames
>
> hth
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>


-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
lol

On Wed, Sep 23, 2009 at 10:06 AM, Martin Gainty <mg...@hotmail.com> wrote:
>
> what you said originally about Interceptors being built only with Struts specific org.apache.struts2.impl.StrutsObjectFactory
> (and not spring's StrutsSpringObjectFactory and not StrutsSpringObjectFactory) is true
>
> Spring does handle injected interceptors via setInterceptorNames of ProxyFactoryBean
> http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames
>
> hth
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Wed, 23 Sep 2009 09:23:44 -0700
>> Subject: Re: Interceptor IOC with Spring
>> From: musachy@gmail.com
>> To: user@struts.apache.org
>>
>> that makes sense, I use @Resource(name = "mybean") on my setter
>> methods, so I guess it is just the annotations the ones that do not
>> work.
>>
>> musachy
>>
>> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com> wrote:
>> > In my struts.xml I have:
>> >
>> >  <constant name="struts.objectFactory" value="spring"/>
>> >
>> > And at the top of my applicationContext.xml I have:
>> >
>> > <beans default-autowire="autodetect" xmlns=...>
>> >
>> > And my Interceptors are getting injected just fine.  On another project, I
>> > have autowiring turned off, but then you have to define each interceptor as
>> > a bean in the applicationContext.xml and specifically define the objects
>> > that get injected into it.
>> >  (*Chris*)
>> >
>> > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
>> > list-subscriptions@secmgmt.com> wrote:
>> >
>> >> Correct me if I'm wrong, please, but if I have an interceptor, it should
>> >> get
>> >> injected by spring.
>> >>
>> >> I have a bean I'm expecting, the set method written, and the bean defined
>> >> in
>> >> applicationContext.
>> >>
>> >> My main struts.xml has:
>> >>
>> >> <constant name="struts.objectFactory"
>> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>> >>
>> >> My setter is not getting called, is there anything else I need to do?
>> >>
>> >>
>> >> M.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Hotmail: Free, trusted and rich email service.
> http://clk.atdmt.com/GBL/go/171222984/direct/01/



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Interceptor IOC with Spring

Posted by Martin Gainty <mg...@hotmail.com>.
what you said originally about Interceptors being built only with Struts specific org.apache.struts2.impl.StrutsObjectFactory 
(and not spring's StrutsSpringObjectFactory and not StrutsSpringObjectFactory) is true

Spring does handle injected interceptors via setInterceptorNames of ProxyFactoryBean
http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames

hth
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 23 Sep 2009 09:23:44 -0700
> Subject: Re: Interceptor IOC with Spring
> From: musachy@gmail.com
> To: user@struts.apache.org
> 
> that makes sense, I use @Resource(name = "mybean") on my setter
> methods, so I guess it is just the annotations the ones that do not
> work.
> 
> musachy
> 
> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com> wrote:
> > In my struts.xml I have:
> >
> >  <constant name="struts.objectFactory" value="spring"/>
> >
> > And at the top of my applicationContext.xml I have:
> >
> > <beans default-autowire="autodetect" xmlns=...>
> >
> > And my Interceptors are getting injected just fine.  On another project, I
> > have autowiring turned off, but then you have to define each interceptor as
> > a bean in the applicationContext.xml and specifically define the objects
> > that get injected into it.
> >  (*Chris*)
> >
> > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> > list-subscriptions@secmgmt.com> wrote:
> >
> >> Correct me if I'm wrong, please, but if I have an interceptor, it should
> >> get
> >> injected by spring.
> >>
> >> I have a bean I'm expecting, the set method written, and the bean defined
> >> in
> >> applicationContext.
> >>
> >> My main struts.xml has:
> >>
> >> <constant name="struts.objectFactory"
> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
> >>
> >> My setter is not getting called, is there anything else I need to do?
> >>
> >>
> >> M.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/171222984/direct/01/

Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
that makes sense, I use @Resource(name = "mybean") on my setter
methods, so I guess it is just the annotations the ones that do not
work.

musachy

On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt <th...@gmail.com> wrote:
> In my struts.xml I have:
>
>  <constant name="struts.objectFactory" value="spring"/>
>
> And at the top of my applicationContext.xml I have:
>
> <beans default-autowire="autodetect" xmlns=...>
>
> And my Interceptors are getting injected just fine.  On another project, I
> have autowiring turned off, but then you have to define each interceptor as
> a bean in the applicationContext.xml and specifically define the objects
> that get injected into it.
>  (*Chris*)
>
> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
> list-subscriptions@secmgmt.com> wrote:
>
>> Correct me if I'm wrong, please, but if I have an interceptor, it should
>> get
>> injected by spring.
>>
>> I have a bean I'm expecting, the set method written, and the bean defined
>> in
>> applicationContext.
>>
>> My main struts.xml has:
>>
>> <constant name="struts.objectFactory"
>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>
>> My setter is not getting called, is there anything else I need to do?
>>
>>
>> M.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Interceptor IOC with Spring

Posted by Chris Pratt <th...@gmail.com>.
In my struts.xml I have:

  <constant name="struts.objectFactory" value="spring"/>

And at the top of my applicationContext.xml I have:

<beans default-autowire="autodetect" xmlns=...>

And my Interceptors are getting injected just fine.  On another project, I
have autowiring turned off, but then you have to define each interceptor as
a bean in the applicationContext.xml and specifically define the objects
that get injected into it.
  (*Chris*)

On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski <
list-subscriptions@secmgmt.com> wrote:

> Correct me if I'm wrong, please, but if I have an interceptor, it should
> get
> injected by spring.
>
> I have a bean I'm expecting, the set method written, and the bean defined
> in
> applicationContext.
>
> My main struts.xml has:
>
> <constant name="struts.objectFactory"
> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>
> My setter is not getting called, is there anything else I need to do?
>
>
> M.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Interceptor IOC with Spring

Posted by Mike Baranski <li...@secmgmt.com>.
OK, thanks, is there a JIRA for this?  I'll be happy to request it as an
enhancement...

>-----Original Message-----
>From: Musachy Barroso [mailto:musachy@gmail.com]
>Sent: Wednesday, September 23, 2009 11:23 AM
>To: Struts Users Mailing List
>Subject: Re: Interceptor IOC with Spring
>
>interceptors and  results do net get dependencies injected. If you
>implement BeanFactoryAware, or ApplicationContextAware it will pass
>you the bean factory or the context. I will take a look at this, as it
>has been bothering me for a while.
>
>musachy
>
>On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski
><li...@secmgmt.com> wrote:
>> Correct me if I'm wrong, please, but if I have an interceptor, it
>should get
>> injected by spring.
>>
>> I have a bean I'm expecting, the set method written, and the bean
>defined in
>> applicationContext.
>>
>> My main struts.xml has:
>>
>> <constant name="struts.objectFactory"
>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>>
>> My setter is not getting called, is there anything else I need to do?
>>
>>
>> M.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
>--
>"Hey you! Would you help me to carry the stone?" Pink Floyd
>
>---------------------------------------------------------------------
>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


Re: Interceptor IOC with Spring

Posted by Musachy Barroso <mu...@gmail.com>.
interceptors and  results do net get dependencies injected. If you
implement BeanFactoryAware, or ApplicationContextAware it will pass
you the bean factory or the context. I will take a look at this, as it
has been bothering me for a while.

musachy

On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski
<li...@secmgmt.com> wrote:
> Correct me if I'm wrong, please, but if I have an interceptor, it should get
> injected by spring.
>
> I have a bean I'm expecting, the set method written, and the bean defined in
> applicationContext.
>
> My main struts.xml has:
>
> <constant name="struts.objectFactory"
> value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
>
> My setter is not getting called, is there anything else I need to do?
>
>
> M.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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