Sorry - I className shouldn't have been in there:
<exception
     key="error.Exception"
     scope="request"
     handler="net.ruready.struts.common.exception.MailExceptionHandler"
     type="java.lang.Exception"
     path="/switchMod.do?prefix=/error&amp;page=/system.do" >
  <set-property key="module" value="/users"/>
</exception>

Niall

On 3/23/07, Niall Pemberton <[EMAIL PROTECTED]> wrote:
On 3/23/07, Oren Livne <[EMAIL PROTECTED]> wrote:
> P.S. is there an equivalent attribute to "module" for global and/or
> local exception attributes? Right now I have:
>         <exception key="error.Exception"
>         scope="request"
>         handler="net.ruready.struts.common.exception.MailExceptionHandler"
>         type="java.lang.Exception"
>         path="/switchMod.do?prefix=/error&amp;page=/system.do" />
>
> I want to have module="/error" and path="/system.do" instead. Could I
> use a global-forward declaration instead of the action path used above?
> (e.g. alias a global forward called "systemError" to use module="/error"
> and path="/system.do" and then write path="systemError")

Unfortunately module was never added for exception handler and the
default implementation just creates an ActionForward from the path.
You could however create your own custom Exception Handler and
configure it with a module "property"

public class MyExceptionHandler extends ExceptionHandler {
    public ActionForward execute(Exception ex, ExceptionConfig ae,
        ActionMapping mapping, ActionForm formInstance,
        HttpServletRequest request, HttpServletResponse response)
        throws ServletException {

        ActionForward af = super.execute(ex, ae, mapping,
formInstance, request, response);
        af.setModule(ae.getProperty("module"));
        return af;

    }
}

You then configure the exception using the <set-property> to specify
the module (note there are two forms to <set-property> - either using
"property" or "key" - in this example you need to use "key"):

<exception
       className="mypackage.MyExceptionConfig"
       key="error.Exception"
       scope="request"
       handler="net.ruready.struts.common.exception.MailExceptionHandler"
       type="java.lang.Exception"
       path="/switchMod.do?prefix=/error&amp;page=/system.do" >
    <set-property key="module" value="/users"/>
</exception>

Niall

> Thanks
> Oren
>
> Oren Livne wrote:
> > Dear Niall:
> >
> > Thanks so much .You are a life saver. It works. Just one note -- the
> > syntax that works is:
> >
> >> <forward
> >>         module="/user"
> >>         name="userHome"
> >>         path="/home.do"
> >>         redirect="true" />
> >>
> > Here the module must start with a "/", and the path is relative to the
> > module's URL.
> >
> > Thanks!
> > Oren
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> ======================================================================
> Oren Livne, Ph.D.
> Research Assistant Professor of Mathematics
> RUReady Software Architect
>
> Academic Outreach and Continuing Education
> 1901 East South Campus Dr., Room 2197-D
> University of Utah, Salt Lake City, UT 84112-9399
> Tel  : (801) 581-6831     Cell: (801) 631-3885     Fax: (801) 585-5414
> Email: [EMAIL PROTECTED]              Web:  http://ruready.net/oren
> ======================================================================
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to