Sorry, one more thing.

With removing the @Service annotation I delegated the instantiation of
the Actions to Struts as the Spring component scanner will not find my
Bean no more. Struts - to my knowledge - will somehow create the bean
using Spring too.

The problem to use the applicationContext outside the web environment, i
.e. test cases.

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?

On Mon, Mar 13, 2017, at 18:29, Christian Grobmeier wrote:
> 
> 
> On Mon, Mar 13, 2017, at 18:26, Lukasz Lenart wrote:
> > 2017-03-13 17:55 GMT+01:00 Christian Grobmeier <grobme...@apache.org>:
> > > Removing @Service helped. In addition I had to remove the remaining
> > > Actions from applicationContext.xml (I am in the middle of a
> > > transition).
> > >
> > > It's kind a weird, because it worked with the previous version of
> > > Struts. Was there a change in the injection behavior? I am glad I know
> > > about @Service yet, but still, I would love to know.
> > 
> > No, it isn't related to an injection mechanism, I mean there was no
> > change as far I know. Basically defining actions as services is a bad
> > idea - actions should be clients for services not to provide them. As
> > ActionSupport implements LocaleProvider by default it means it can be
> > injected in any bean that requires it (e.g. I18NInterceptor).
> > 
> > I am not sure why it worked before, LocaleProvider is there for a bit
> > and it's used in few places but since 2.5.5 is also used in the
> > interceptor https://issues.apache.org/jira/browse/WW-4677 - maybe
> > that's the case.
> 
> Got it, thank you a lot. 
> 
> Christian
> 
> > 
> > 
> > Regards
> > -- 
> > Ɓukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > ---------------------------------------------------------------------
> > 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
> 

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

Reply via email to