struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <strut...@reumann.net>
Subject Re: [HELP] How could I catch and process Errors in Struts + iBatis + DAO?
Date Thu, 24 Mar 2005 20:19:22 GMT
Folashade Adeyosoye wrote the following on 3/24/2005 10:59 AM:
> Agood way that i have found out was to define a  BaseExceptionHandler.java class

Yes my Struts apps have this also. Actually I no longer catch any 
Exceptions in my Actions and let this Base class handle it all. Makes 
your Actions much cleaner in my opinion.

So in my struts-config I have something like:

<global-exceptions>
	<exception handler="com.foo.bar.AppExceptionHandler" 
key="error.general" path="/WEB-INF/jsp/exception.jsp" 
type="java.lang.Exception"/>
     </global-exceptions>

Any exceptions that make it to the Action will propogate to the above 
handler. Then you can do additional logging and forward to a nicer error 
display page.

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message