DispatchActionの拡張ポイント
Struts1.x系のDispatchActionやEventDispatchActionを拡張するなら以下のようにすると良いですよ。
たとえばログ出力処理を共通化するならこんな感じでしょうか。
public class BsaeAction extends EventDispatchAction { @Override protected ActionForward dispatchMethod( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String name) throws Exception { log.info(this.clazz + "#" + name + " start"); ActionForward forward = super.dispatchMethod(mapping, form, request, response, name); log.info(this.clazz + "#" + name + " end"); return forward; } }
executeメソッドじゃないところがポイントです。