not sure if that would do it... you'd want to plug back into the exception dispatcher... probably more something like this. i copied this from struts RequestProcessor... i haven't tested it yet, its just an idea:
Code:
public class UnwrappingActionExecutionExceptionHandler extends ExceptionHandler {
public ActionForward execute(
Exception ex,
ExceptionConfig ae,
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException {
// might not be necessary since it should always be the correct exception
if (!(ex instanceof ActionExecutionException)) {
throw new ServletException("wrong exception");
}
// might want to check if the cause is also ActionExecutionException
// to prevent loops, but that seems unlikely to happen
Throwable cause = ((ActionExecutionException) ex).getCause();
if (cause == null || !(cause instanceof Exception)) {
throw new ServletException("no underlying cause");
}
// Is there a defined handler for this exception?
ExceptionConfig config = mapping.findException(cause.getClass());
if (config == null) {
log.warn(getInternal().getMessage("unhandledException", exception.getClass()));
if (exception instanceof ServletException) {
throw (ServletException) cause;
} else {
throw new ServletException(cause);
}
}
// Use the configured exception handling
try {
ExceptionHandler handler = (ExceptionHandler)
RequestUtils.applicationInstance(config.getHandler());
return (handler.execute(cause, config, mapping, form, request, response));
} catch (Exception e) {
throw new ServletException(e);
}
}
}