RE: Struts2 + applicationContext.xml

2008-06-30 Thread Brad A Cupit
Lukasz Lenart wrote: > Exactly, first, Struts (default object factory) will > create action object and then it will *ask* Spring > to inject depended beans, base on applicationConfig.xml. > I'm just wondering, if there any drawbacks for this? The only one I can think of is that your actions wouldn

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Alberto A. Flores
Have you considered using the @Controller annotation (stereotype) on all Struts2 Actions (this way, Spring knows the bean id name). You can always control the scoping of the object @Controller("fooAction") @Scope("request") public class MyFooAction { } I found this a cleaner (and easier) way

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Frans Thamura
> I'm not sure what you're asking, but actions not defined in the Spring config > file will still be injected by beans that *are* in the Spring config file. > i think the idea to make the action package inside spring i have experience, writing action is another bored repeated job -

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
>> But in such way, first action will be created by Struts and >> then Spring will inject dependency to it, does it? > I'm not sure what you're asking, but actions not defined in the Spring config > file will still be injected by beans that *are* in the Spring config file. Exactly, first, Struts

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Dave Newton
--- On Mon, 6/30/08, Lukasz Lenart wrote: > I said: >> Actually, you don't. If you're using Spring as >> the object factory and are auto-wiring by name >> (which can, on occasion, lead to spectacular >> debugging opportunities) it's not necessary to >> define the actions, AFAICT. > > But in such

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
> Actually, you don't. If you're using Spring as the object factory and are > auto-wiring by name (which can, on occasion, lead to spectacular debugging > opportunities) it's not necessary to define the actions, AFAICT. But in such way, first action will be created by Struts and then Spring will

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Dave Newton
--- On Mon, 6/30/08, Lukasz Lenart wrote: >> Do I have to defined EVERY action in applicationContext.xml ? > Yes if you want to create them by Spring and remember to > use name defined in applicationContext.xml as class in struts.xml Actually, you don't. If you're using Spring as the object factor

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
> Do I have to defined EVERY action in applicationContext.xml ? Yes if you want to create them by Spring and remember to use name defined in applicationContext.xml as class in struts.xml Regards -- Lukasz http://www.lenart.org.pl/ ---

Struts2 + applicationContext.xml

2008-06-30 Thread Kibo
Hi konference I use Struts2 + Spring. I deployed the "Struts 2 - Maven Archetype - Starter" In file applicationContext.xml is defined bean - helloWorldAction. I read that Struts2 expects that each action is a new instance. Therefore is there : singleton="false" Do I have to de