struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@apache.org>
Subject Re: LocaleProvder not unique
Date Mon, 13 Mar 2017 20:51:45 GMT
OK, using component scan i had success with using DefaultLocaleProvider
as default in my applicationContext.xml:
<bean name="localeProvider"
class="com.opensymphony.xwork2.DefaultLocaleProvider" primary="true" />

(mind the primary)

So far it makes halfway sense to me. A few tests fail still because they
access getText and do no receive a context. Digging into this

On Mon, Mar 13, 2017, at 20:44, Christian Grobmeier wrote:
> 
> 
> On Mon, Mar 13, 2017, at 19:08, Lukasz Lenart wrote:
> > 2017-03-13 19:03 GMT+01:00 Christian Grobmeier <grobmeier@apache.org>:
> > > Wether @Service was right or not, I need to somehow tell Spring how to
> > > find my beans (i.e. @Component).
> > > I can understand Springs confusion, when it realizes every Action is a
> > > LocaleProvider.
> > >
> > > Is there any best practice?
> > 
> > Struts will delegate creation of any object to Spring, if Spring fails
> > it will fall back to Struts ObjectFactory to create the object. So as
> > far I know, Spring should be able create an object from a class with
> > default constructor implemented.
> 
> Sure, but if you use the Spring component scanner, we are back to the
> problem I was running into earlier. Because if I am not having an
> annotation, it's not picked up by Spring, but by Struts, which returns
> it to Spring. Standard testing is very difficult.
> 
> 
> > 
> > 
> > Regards
> > -- 
> > Ɓukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > ---------------------------------------------------------------------
> > 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


Mime
View raw message