Okay, eventually I figured that out myself:
- so, as per the wiki, the web.xml should have the following for the wicket
filter:
<filter-mapping>
<filter-name>wicket</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
- the WebApplication subclass would have something like this (may be
unconditional if needed for both development and deployment modes):
if (DEPLOYMENT.equalsIgnoreCase(getConfigurationType())) {
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_NO_EXCEPTION_PAGE);
}
...
public final RequestCycle newRequestCycle(final Request request, final
Response response) {
return new ExceptionHandlingRequestCycle (this, (WebRequest)request,
(WebResponse)response);
}
- the exception handling request cycle subclass would have (again, may be
unconditional if needed for both development and deployment modes)
public final Page onRuntimeException(final Page page, final
RuntimeException e) {
if
(WebApplication.DEPLOYMENT.equalsIgnoreCase(getApplication().getConfigurationType()))
{
throw new
AbortWithWebErrorCodeException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} else {
return super.onRuntimeException(page, e);
}
}
Note the AbortWithWebErrorCodeException - it's not the
AbortWithHttpStatusException (which doesn't work).
- now in the web.xml you can have:
<error-page>
<error-code>500</error-code>
<location>/xxx</location>
</error-page>
/xxx may be either another wicket mounted path or it may be a static
resource not managed by wicket. Now you have "standard" (specwise) error
handling support in the web app.
--
View this message in context:
http://n4.nabble.com/Exception-propagation-tp1934370p2016271.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]