Why not have a base action that has the setters and getters (which extends ActionSupport), put the methods in there, and have all your actions extend that instead of ActionSupport.
Mike. >-----Original Message----- >From: Musachy Barroso [mailto:musa...@gmail.com] >Sent: Tuesday, September 08, 2009 10:11 PM >To: Struts Users Mailing List >Subject: Re: [S2] Accessing objects in the Spring context? > >I stand corrected. For some (unknown) reason I always thought that >interceptors and results where created by Class.forName(...) > >musachy > >On Tue, Sep 8, 2009 at 6:37 PM, Musachy Barroso<musa...@gmail.com> >wrote: >> nope. >> >> On Tue, Sep 8, 2009 at 6:32 PM, James Carr<james.r.c...@gmail.com> >wrote: >>> Couldn't I just make it ApplicationContextAware? >>> >>> On Tue, Sep 8, 2009 at 8:27 PM, Musachy Barroso<musa...@gmail.com> >wrote: >>>> >WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActio >nContext.getServletContext()); >>>> >>>> On Tue, Sep 8, 2009 at 6:12 PM, James Carr<james.r.c...@gmail.com> >wrote: >>>>> I can try it out... how can I make the bean factory available to my >interceptor? >>>>> >>>>> Thanks, >>>>> James >>>>> >>>>> On Tue, Sep 8, 2009 at 6:12 PM, Wes Wannemacher<w...@wantii.com> >wrote: >>>>>> I guess I sort of misunderstood your problem. Another approach >would >>>>>> be to retrieve the beans in an interceptor and push them onto the >>>>>> value stack. As long as you give them a name they should be >available >>>>>> from the view. This approach will keep you from changing any of >the >>>>>> action code. If you want to get really tricky you could try to >figure >>>>>> out a declarative way to indicate which beans you want, per action >>>>>> invocation. I would whip up a quick example but I'm on my phone, >maybe >>>>>> later tonight if no one else steps to the challenge. >>>>>> >>>>>> On 9/8/09, James Carr <james.r.c...@gmail.com> wrote: >>>>>>> Yeah, I was looking for a way around it... these are simple hash >maps >>>>>>> that are used to display select options. I wound up with an >action >>>>>>> with 5 Maps in it :( >>>>>>> >>>>>>> Thanks, >>>>>>> James >>>>>>> >>>>>>> On Tue, Sep 8, 2009 at 4:26 PM, Wes Wannemacher<w...@wantii.com> >wrote: >>>>>>>> You could use the @Autowire annotation directly on a property... >But I >>>>>>>> don't really see how that is better than using setter-based >injection. >>>>>>>> Just because the beans are singletons doesn't mean anything >special, >>>>>>>> you still need a reference to them in your struts action. >>>>>>>> >>>>>>>> -Wes >>>>>>>> >>>>>>>> On Tue, Sep 8, 2009 at 5:13 PM, James >Carr<james.r.c...@gmail.com> wrote: >>>>>>>>> I have several singleton based beans defined in my >>>>>>>>> applicationContext.xml and I'd like to just use these rather >than >>>>>>>>> being forced to set them on my action. is there any way to >accomplish >>>>>>>>> this? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> James >>>>>>>>> >>>>>>>>> --------------------------------------------------------------- >------ >>>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Wes Wannemacher >>>>>>>> >>>>>>>> Head Engineer, WanTii, Inc. >>>>>>>> Need Training? Struts, Spring, Maven, Tomcat... >>>>>>>> Ask me for a quote! >>>>>>>> >>>>>>>> ---------------------------------------------------------------- >----- >>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> ----------------------------------------------------------------- >---- >>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Wes Wannemacher >>>>>> >>>>>> Head Engineer, WanTii, Inc. >>>>>> Need Training? Struts, Spring, Maven, Tomcat... >>>>>> Ask me for a quote! >>>>>> >>>>>> ------------------------------------------------------------------ >--- >>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>> >>>>>> >>>>> >>>>> ------------------------------------------------------------------- >-- >>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> "Hey you! Would you help me to carry the stone?" Pink Floyd >>>> >>>> -------------------------------------------------------------------- >- >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>> For additional commands, e-mail: user-h...@struts.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@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-unsubscr...@struts.apache.org >For additional commands, e-mail: user-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org