Hi, What you want to do here, explain to us if so we can provide better solutions how it should be done in struts2 style.
Java Rocks. On Thu, Jun 28, 2012 at 9:44 PM, samsongbest <[email protected]> wrote: > Hi Aum, > > Let me give you some simple code. > > public Class BaseAction{ > > //constructor method > public BaseAction() { > property = ...; > } > > String property; > > //get > //set > } > > I think any other action extends BaseAction can use "property" directly > without calling any other method. > Is that what you want? > > > > > Best Regards, > Sam Song > Cognizant Technology Solutions > > From: Aum Strut > Date: 2012-06-29 00:36 > To: samsongbest > CC: Struts Users Mailing List > Subject: Re: Using Base Action for application (struts2) > I am not sure what you mean by constructor method?? > u mean prepare method?? > > > On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <[email protected]> > wrote: > > Hi Aum, > > How about put the init type work in the constructor method of the > BaseAction? > > > > > Best Regards, > Sam Song > Cognizant Technology Solutions > > From: Aum Strut > Date: 2012-06-29 00:05 > To: Struts Users Mailing List > Subject: Using Base Action for application (struts2) > Hi All, > > I am not sure how to do this, i am planning to create a BaseAction class > and will do some init type work here which should be available to each and > every action without need to call that specific method. > > Idea is to create a property which is needed by each and every > Action/Request and i don't want to call that method from each and every > action. > > is there a way to achieve this? >

