...
Code Block | ||||
---|---|---|---|---|
| ||||
public class SomeWebApplication extends WebApplication { @Override protected void init() { getRequestCycleListeners().add(new IRequestCycleListener() { { public void onExceptiononBeginRequest(Exception ex) { // optionally do something at herethe whenebeginning there'sof anthe exceptionrequest } public void onEndRequest() { // optionally do something at the end of the request } public voidIRequestHandler onBeginRequest(onException(RequestCycle cycle, Exception ex) { // optionally do something at the beginning of the request here when there's an exception // then, return the appropriate IRequestHandler, or "null" // to let another listener handle the exception } // ... more methods for various events as per IRequestCycleListener }); } @Override public Class<? extends Page> getHomePage() { return SomePage.class; } } |
...
In Wicket 1.4 it was needed to extend org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException).
Wicket 1.5 gives even better control, by overriding org.apache.wicket.Application.newExceptionMapper() it is possible to change even the default processing of error pages.
For information on how the request cycle handles exceptions see RequestCycle in Wicket 1.5 for more information
ImageMap removed
ImageMap was deprecated in 1.4.11 and in 1.5 it was replaced with ClientSideImageMap component
...