Hi, Let assume your base class is like this: public class BaseAction extends ActionSupport { private MyService myService; public void setMyService(MyService service) { this.myService = service; }
//put others getter and setter here... } public class FooAction extends BaseAction { //do whatever you want with myService } public class BarAction extends BaseAction { //create anything you like with myService } in your applicationContext.xml, declare something shown below: <bean id="baseAction" class="your.package.name.BaseAction" abstract="true"> <property name="myService" ref="myService"/> </bean> <bean id="fooAction" class="your.foo.package.name.FooAction" parent="baseAction"/> <bean id="barAction" class="your.bar.package.name.BarAction" parent="baseAction"/> HTH MK Tan On 5/23/07, Roger Varley <[EMAIL PROTECTED]> wrote:
Hi I suspect that this going to be a stupid question but please bear with me. I have a BaseAction for my application that extends ActionSupport and all my actions extend BaseAction. BaseAction recieves a reference to a Service bean, through which my actions obtain objects from my Business Layer, by injection from the Spring container. Is there a way of configuring Struts and Spring so that I only need to do this for my BaseAction and therefore avoid having to define all my actions to Spring or do I still need to inject the Service object into each action. I'm sorry if this is a really stupid question, but this is all new stuff to me. Regards Roger --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]