Hi guys,

We recently got into a little bit of trouble with Tapestry's URL
shortening. We have a ComponentRequestFilter that restricts access to pages
based on annotations placed on the pages classes.

With the following setup, tapestry gets mixed up about the page annotations:

   1. We have a page Choose with annotation Bar
   2. We also hava a page ChoseFoo with annotation Baz.
   3. Both pages live in the package foo.

In the ComponentRequestFilter we have the following code (edited for
brevity):

   handlePageRender(PageRenderRequestParameters params,
                    ComponentRequestHandler handler) {
        String pageName params.getLogicalPageName();
        Component page = _componentSource.getPage(pageName);
        MyAnnotation annotation =
_page.getClass().getAnnotation(MyAnnotation.class);

        ...

        handler.handlePageRender(parameters);
    }

When the request filter handles a request for page "Choose", the component
source ends picking up the page "ChooseFoo". It seems that tapestry's
logical page name shortening doesn't handle cases where more than one page
resolve to the same logical name. In this case we expected tapestry to pick
up the correct class as there is an exact match for it, or maybe issue a
warning about two pages having a name collision.

At the moment we changed the page names to avoid the problem. ¿Do you think
this is a bug? ¿Should a ticket be opened for it?
Thanks,
Mauricio

Reply via email to