I dug a bit deeper into this and found that in struts-1.1
there's a global-exceptions facility in struts-config.xml
Where you can declaratively handle exceptions for example:
<global-exceptions>
<exception key="system.error"
type="java.lang.Exception"
path="/appError.jsp"/>
</global-exceptions>
But I'm still a bit confused. Would people recommend using
this?
How do you folks handle system exceptions?
Cheers,
Brian
-----Original Message-----
From: Brian McSweeney [mailto:[EMAIL PROTECTED]
Sent: 26 August 2003 12:50
To: 'Struts Users Mailing List'
Subject: how to handle unknown exceptions/errors
Hi all,
Is there a standard way to handle all unknown exceptions in
Struts?
For example in my Action classes I normally
Catch specific exceptions and forward to specific error pages.
But for all other exceptions should I just forward to a global
Errors page?
Eg:
In my struts action
public class MyAction extends BaseAction
{
//~ Methods
----------------------------------------------------------------
protected ActionForward doExecute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
{
// do stuff
catch(SpecificException se){
forward to specific error page
}
catch(Exception e){
forward to global error page
}
}
}
Is this how it generally works?
Cheers,
Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]