"Craig R. McClanahan" <[EMAIL PROTECTED]> writes:

> In Struts 1.0, you could implement this by extending ActionServlet and
> override, say, processActionPerform() to add your check.  That's certainly
> feasible, but it requires an understanding of the internals of
> ActionServlet.

Or, you could extend Action in a BaseAction like

    public ActionForward perform(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
        throws IOException, ServletException 
    {
        try
        {
            if (!isRuntimeValid(request))
            {
                return forwardToLogin(mapping,request);
            }
            
            return performAction(mapping,form,request,response);
        }
        catch (Exception exp)
        {
            Log.error("Exception in perform()",exp);
            request.setAttribute(Parameter.EXCEPTION_REQ,exp);
            return mapping.findForward("error-jsp");
        }
    }

and let your specific Action extend BaseAction and implement a
'performAction()' method.

-- 
                                                        ...roland huss
                                                             consol.de

Reply via email to