How do I make sure first time DispatchAction is invoked it calls some initialization code ! I have Business object Dao service class which I want to instantiate before any of the action forward or any methods from myDispathAction is called .
My current dispatchAction look like this ... public class SectorAction extends DispatchAction { public ActionForward getSectors(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } public ActionForward setUpForInsertOrUpdate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } } What I want to do is something like this as very first thing before any of the method from this action is called. sectService = new SectorDaoService(request); sectOwnerService = new SectorOwnerDaoService(); sectService.getSectors(); This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates