It wasn't that hard. :)
Something like this:

public class CustomExceptionPresenter
        extends ExceptionPresenterImpl
        implements ExceptionPresenter
{
        private WebResponse response;

        public CustomExceptionPresenter(WebResponse response)
        {
                this.response = response;
        }

        @Override
        public void presentException(IRequestCycle cycle, Throwable t)
        {
                if (t instanceof PageNotFoundException)
                {
                        response.setStatus(404);
                }
                super.presentException(cycle, t);
        }
}

On Sun, 24 Sep 2006 03:49:00 +0200, Martin Strand <[EMAIL PROTECTED]> wrote:

I want to make the servlet container show its standard 404 page instead of the exception page on PageNotFoundExceptions. I assume I'll need to write a custom ExceptionPresenter, but from there, how do I tell the servlet container to send a 404?

Thanks,
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to