On Monday 16 February 2009 13:47:50 Sundararaman, Anand wrote: > The validation is fine as it works when I scope my actions as singleton in > the applicationContext.xml. Problem happens only when I scope them as > prototype. > > When you say that Struts will try to use Spring to create all framework > objects, is it possible to configure such a way that the action classes are > instantiated by Struts but later they are autowired to Spring service > beans. If possible can you direct me on how to configure that way? >
There is a Spring autowiring interceptor that will autowire services into your actions for you, even if you don't use Spring to instantiate the actions. It is pretty slick. I use it with the convention plugin, I set the autowiring to "by name" and then let convention configure the actions/dispatches and then get magically wired with services. This cuts down the Spring XML quite a bit since I only have the beans configured and Struts configuration is nearly nil. -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org