You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2007/09/07 09:22:31 UTC

[jira] Commented: (WICKET-785) would like PageNotFoundException which returns a 404 and generalized http error code returning base exception class

    [ https://issues.apache.org/jira/browse/WICKET-785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525620 ] 

Igor Vaynberg commented on WICKET-785:
--------------------------------------

see AbortWithHttpStatusException, so throw new AbortWithHttpStatusException(404);

> would like PageNotFoundException which returns a 404 and generalized http error code returning base exception class
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-785
>                 URL: https://issues.apache.org/jira/browse/WICKET-785
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.4.0-alpha
>            Reporter: Jonathan Locke
>            Assignee: Igor Vaynberg
>
> instead of having to do this manually, it would be nice if we had a simple PageNotFoundException we could throw to return a 404 for a page.
>             getRequestCycle().setRequestTarget(EmptyRequestTarget.getInstance());
>             try {
>                 getWebRequestCycle().getWebResponse().getHttpServletResponse().sendError(404);
>             } catch (IOException e) {
>                 e.printStackTrace();
>             }
> it might also be quite nice to have a more general base class for the 404 exception that can return other errors like 403, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.