I haven't tried such a thing yet, but the last chapter of Wicket in
Action describes how to do such things.
Here's the example they give for "responding with different error pages
for specific errors.
public class CheesrRequestCycle extends WebRequestCycle {
public CheesrRequestCycle(WebApplication application, WebRequest
request, Response response) {
super(application, request, response);
}
@Override
public Page onRuntimeException(Page page, RuntimeException e) {
Throwable cause = e;
if(cause instanceof WicketRuntimeException)
cause = cause.getCause();
if(cause instanceof InvocationTargetException)
cause = cause.getCause();
if (cause instanceof OutOfCheeseException) {
return new CheesrErrorPage();
}
return super.onRuntimeException(page, e);
}
}
Regards,
Linda
Thomas Singer wrote:
As I have reported a couple of weeks ago (but can't find the message any
more for a follow-up), Wicket shows an ugly internal-error page if one
somehow modified the stateful URLs, e.g.
http://localhost:8080/?wicket:interface=:8
Following exception is logged:
org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException: Internal error parsing
wicket:interface = :6
at
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
at org.apache.wicket.Request.getRequestParameters(Request.java:172)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
How to configure Wicket to show the configured 404-page instead?
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.420 / Virus Database: 270.14.2/2408 - Release Date: 10/01/09 18:23:00
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]