How do you get access to the exception that was thrown when your action is called by the container (i.e. from the error-page directive in web.xml)? for example: a custom tag throws an exception, it is caught by the container and the container forwards to my action. so where is the exception object stored now so that my action can log it? For sure I can log that there *was* an exception, but how do I know what it was?

After looking back at my app...I'm actually not logging exceptions thrown in JSPs. I use Tiles controllers to load all of my JSP data and I catch and log any exceptions thrown by my controllers. The JSPs only display data so there is little chance of them throwing an exception (unless I've coded the page wrong but I find those errors during development).



The Servlet 2.3 spec (section 9.9) doesn't say that the exception is accessible to the error page, neither does Sun's servlet tutorial:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Servlets4.html#64301

There is a standard request attribute name that the exception is stored under. I can't recall the exact name but it's defined in the Servlet spec. I'm assuming that if you map an Action to an <error-page> definition in web.xml it will have access to that request attribute but I have never tried it.


David


And if it *is* available somehow to the action specified in the error-page directive in the web.xml, then what would be the reason to use an ExceptionHandler in struts as well, even if it shares the same error-handling code?


Thanks.


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


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



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



Reply via email to