wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eyal Golan <egola...@gmail.com>
Subject AbortWithWebErrorCodeException and RequestCycle newRequestCycle
Date Thu, 03 Sep 2009 08:27:21 GMT
We have in our application the following code:
     * @see
     *      org.apache.wicket.Response)
    public RequestCycle newRequestCycle(final Request request,
            final Response response) {
        return new WebRequestCycle(this, (WebRequest) request,
                (WebResponse) response) {

            public Page onRuntimeException(Page page, RuntimeException e) {
                if (DEPLOYMENT.equalsIgnoreCase(getConfigurationType())) {
(PageExpiredException.class.isAssignableFrom(e.getClass())) {
                        return null;
                    } else {
                        return new InternalErrorPage(getErrorDisplay(e));
                } else {
                    // In development we want to see the exception
                    return null;


Also, in our base page we have this
    protected void verifyAccess(PageParameters pageParameters) {
        // Redirect to Login page on invalid access.
        if (!isUserLoggedIn()) {
            throw new RestartResponseAtInterceptPageException(Login.class);
        else if (! isPageAllowed(pageParameters)) {
            String url = pageParameters.getString("url");
            if (url != null) {
                throw new
AbortWithWebErrorCodeException(HttpServletResponse.SC_FORBIDDEN, url);
            else {
                throw new

'verifyAccess' is called in the construction of the page.

The problem I'm having is when the page is not allowed.
We throw AbortWithWebErrorCodeException.

The user gets a 403 error page.
As expected, the onRuntimeException that configured in the WebApp is not

I thought to create a RuntimeException that will be thrown instead of the
AbortWithWebErrorCodeException(...) and to analyze it in the
But, is there a way to map the 403 error page to another page? A setting of
the Application or even in the web.xml?


Eyal Golan

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message