This is what I do in my index page:

package com.baw.website.pages;

import org.apache.tapestry5.EventContext;
import org.apache.tapestry5.services.HttpError;

public class Index
{
    /**
     * Restore 404 Not Found errors
     * @param context
     * @return 
     */
    HttpError onActivate(EventContext context)
    {
        if (context.getCount() == 0)
        {
            return null;
        }

        return new HttpError(404, "Resource not found.");
    }
}
And then add tapestry filter to error processing and have a tapestry NotFound 
page. 
Works great!

On Jan 27, 2013, at 1:16 PM, Massimo Lusetti <mluse...@gmail.com> wrote:

> I'm interested in implementing the handling of requests to nonexistent
> pages.
> 
> This is something that has to work nicely with the concept of "activation
> context" that tapestry5 has since day one.
> 
> Now my solution would be to have the platform (tapestry5) to signal with a
> 404 error when it encounter a request to a nonexistent page or to a page
> with the wrong activation context parameter.
> 
> Before going any further I would like to ask for suggestion on how you
> envision the situation or to know your experience in the fields.
> 
> How do you handle requests to page that actually don't exists in your
> tapestry5 applications?
> 
> Cheers
> -- 
> Massimo

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org

Reply via email to