On Tue, Sep 8, 2009 at 6:54 PM, James Carr wrote:
> Eh, that's the more complicated way... struts2 autowires by name, no
> need to implement ApplicationContextAware.
I didn't realize that. The code in SpringObjectFactory looks for
ContextAware and sets it independently and then calls autowire.
tember 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
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 wrote:
> nope.
>
> On Tue, Sep 8, 2009 at 6:32 PM, James Carr wrote:
>> Couldn't I just make it ApplicationContex
On Tuesday 08 September 2009 09:32:19 pm James Carr wrote:
> Couldn't I just make it ApplicationContextAware?
>
> On Tue, Sep 8, 2009 at 8:27 PM, Musachy Barroso wrote:
> > WebApplicationContextUtils.getRequiredWebApplicationContext(ServletAction
> >Context.getServletContext());
You *can* make it
nope.
On Tue, Sep 8, 2009 at 6:32 PM, James Carr wrote:
> Couldn't I just make it ApplicationContextAware?
>
> On Tue, Sep 8, 2009 at 8:27 PM, Musachy Barroso wrote:
>> WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
>>
>> On Tue, Sep 8, 2009
Couldn't I just make it ApplicationContextAware?
On Tue, Sep 8, 2009 at 8:27 PM, Musachy Barroso wrote:
> WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
>
> On Tue, Sep 8, 2009 at 6:12 PM, James Carr wrote:
>> I can try it out... how can I ma
WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
On Tue, Sep 8, 2009 at 6:12 PM, James Carr 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
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 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
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 t
Eh, that's the more complicated way... struts2 autowires by name, no
need to implement ApplicationContextAware. I think people are missing
the point.
I got it working just fine by adding 10 properties to my action with
appropriate getters and setters, but I'm trying to sneak around having
to add t
On Tue, Sep 8, 2009 at 5:55 PM, James Carr 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 :(
If it were me, this is what I would do.
First,use a Spring object factory in your S
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 wrote:
> You could use the @Autowire annotation directly on a property... But
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
I suppose I may use this:
http://wiki.opensymphony.com/display/ABLE/Expose+Spring+Beans+in+JSP
But I really wish/hope that struts2 has something built in.
Thanks,
James
On Tue, Sep 8, 2009 at 4:13 PM, James Carr wrote:
> I have several singleton based beans defined in my
> applicationContext.xml
14 matches
Mail list logo