public final ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
_log = Logger.getLogger(this.getClass()); if (_log.isDebugEnabled()) { _log.debug(someString); }
try { // Check for precondition errors; fail if found if (preProcess(mapping,form,request,response)) { // Execute actual logic ActionForward forward = executeLogic(mapping,form,request,response); } // Some postprocessing... postProcess(mapping,form,request,response);
return forward;
} catch (SessionNotValidActionException se) { if (_log.isDebugEnabled()) { _log.debug("Session is not valid, redirecting to login."); } return mapping.findForward("login"); } catch (...) { ... } finally { ... }
if (_log.isDebugEnabled()) { _log.debug("Leaving execute method."); } }
and I provide the two methods - preProcess and postProcess - together with an abstract executeLogic method, and some other common helper needs into utility methods.
But Actions classes are often too small, and this ruins the cohesiveness of the application. So I would like to start employing DispactchAction classes to group related actions. Do you have any suggestion on how to implement the above approach (template pattern) to extend DispatchAction, in order to define a BaseDispatchAction?
Thanks, Gianluca
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]