At 5:57 PM +0200 4/28/05, Sébastien GALLET wrote:
Joe Germuska a écrit :

At 3:11 PM +0200 4/24/05, Sébastien GALLET wrote:

Hello,
I'm looking for a good way to manage exceptions in struts.
Any links in your bookmarks ?


That's a pretty general question!

yes, it was :-[
With your help, I can catch exceptions in my servlet and display them in my app.
Is there a way to catch jsp exception (caused by a missing resource for examples) and tiles exception ?

Check out <c:catch> from the JSTL: http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/catch.html


Struts itself doesn't provide any support, because the ExceptionHandler which is distributed in the core always assumes that its safe to forward -- which is illegal once the response is committed, as when you have a tiles exception.

I don't think it would be too much work for someone to adjust the Struts general exception handler so that it tested response.isCommitted() and somehow did a request dispatcher include instead of returning an ActionForward. It would take a bit of thinking to flush out possible wrinkles, but its conceptually pretty simple, except for determining how to best configure it.

Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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



Reply via email to