August 26, 2004
Let your Struts DispatchActions Fall through
This is nice, because now you can have a default behavior on dispatch actions.
public class BaseAction extends DispatchAction
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
String method = request.getParameter(mapping.getParameter());
if (method != null)
{
return dispatchMethod(mapping, form, request, response, method);
}
else
{
return mapping.findForward("success");
}
}
}
Posted by
Andre Mermegas
at
August 26, 2004 12:21 PM
|
TrackBack