Hello,
I'm working on a struts application which has just been deployed and is
being used by a large number of users. I've got an error handler set up
using the global-exceptions tag. It sends me an email whenever it
catches an exception.
My config looks like this:
global-exceptions
Maybe it happens when the error is not thrown by Struts, so try to use
the JSP directive %@ page isErrorPage=true % which give you access
to the implicit variable exception.
You can also use a exception handler :
exception type=java.lang.Throwable
key=error.error
With the caveat that I looked at things for all of 30 seconds so I could
be WAY wrong...
Looking at the Struts source, the RequestProcessor.processException()
method is where your custom handler gets called from. I notice that the
request attribute is NOT set there. In fact, there is no
What I do is log the exception and the stack trace and then let the
super do the rest.
Since I was getting null comming up on the error page, I check the
exception message and if it is null
I at least show the name of the exception class name on the error page
(probably not too pretty but..)
Thanks for your prompt replies!
I will try supplying my own exception handler. Looking at the struts
source code for the exception handler, I see:
// Figure out the error
if (ex instanceof ModuleException) {
error = ((ModuleException) ex).getActionMessage();
5 matches
Mail list logo