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
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
> 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
-
>> 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
--- 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
> 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
--- 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
> 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/
---
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
9 matches
Mail list logo