You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tom Norton <to...@gmail.com> on 2014/02/24 20:41:52 UTC

Forwarding to 404 Page

Let's say I have a detail page with url /widgets/${id}.  If there is no
widget for the given id, how would I redirect the user to the 404 page?
 I'm using wicket 1.5.

Thanks,
Tom

Re: Forwarding to 404 Page

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Since the application code reads the value of 'id' parameter and checks the
DB for an item with this id it is in your control to do:
setResponsePage(My404.class)

Another way is to define a page for 404 in web.xml and just throw
AbortWithHttpErrorCodeException(404). The rest will be handled by the web
container.

Martin Grigorov
Wicket Training and Consulting


On Mon, Feb 24, 2014 at 9:41 PM, Tom Norton <
tomwnorton.mailing.lists@gmail.com> wrote:

> Let's say I have a detail page with url /widgets/${id}.  If there is no
> widget for the given id, how would I redirect the user to the 404 page?
>  I'm using wicket 1.5.
>
> Thanks,
> Tom
>