Author Login
Post Reply
I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity.
Am 19.03.2010 um 15:04 schrieb Mike Oestereter:
> Hello
>
> I've got a page that takes the context as parameter to produce a
> result from db, e.g.: http:/hostname/app/page/123
>
> If the db result for 123 does not exist I would like to throw a 404.
>
> Currently I'm using...
>
> Object onActivate(EventContext context) {
> //db lookup code to prepare page
> }
>
> Is the best way to throw a custom error that gets picked up by the
> ExceptionReport page and "rendered" with a status code of 404?
>
> Or is there a way to initialize/prepare the page earlier in the cycle
> and detect the non existence of resource 123?
>
> Thanks
> Theo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)