Re: Mixup with page resolution

2014-02-04 Thread Thiago H de Paula Figueiredo

On Sun, 02 Feb 2014 17:05:28 -0200, Bob Harner  wrote:


I'm with Lance in thinking that an exception should be thrown. The
exception message should list the conflicting page names, of course.


I prefer to have Tapestry check the longer URL before using the shorter  
one, as in 99.9% of the time there are no conflicting page names.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Mixup with page resolution

2014-02-02 Thread Bob Harner
I'm with Lance in thinking that an exception should be thrown. The
exception message should list the conflicting page names, of course.
On Jan 31, 2014 10:38 AM, "Mauricio Aldazosa" 
wrote:

> On Thu, Jan 30, 2014 at 2:35 AM, Lance Java  >wrote:
>
> > > but I'd also call that a very confusing naming of pages.
> >
> >
> Granted :-), we have already changed the names. I also created a jira
> issue: https://issues.apache.org/jira/browse/TAP5-2281 for it. I'll be
> happy to provide a patch if a consensus is reached on how to handle this
> (warning, exception, etc).
>
> Thanks for your answers,
> Mauricio
>


Re: Mixup with page resolution

2014-01-31 Thread Mauricio Aldazosa
On Thu, Jan 30, 2014 at 2:35 AM, Lance Java wrote:

> > but I'd also call that a very confusing naming of pages.
>
>
Granted :-), we have already changed the names. I also created a jira
issue: https://issues.apache.org/jira/browse/TAP5-2281 for it. I'll be
happy to provide a patch if a consensus is reached on how to handle this
(warning, exception, etc).

Thanks for your answers,
Mauricio


Re: Mixup with page resolution

2014-01-30 Thread Lance Java
> but I'd also call that a very confusing naming of pages.

Agreed! I'd say a possible 'fix' would be for Tapestry to throw exception
when it encounters the two ambiguous pages at startup.


Re: Mixup with page resolution

2014-01-29 Thread Thiago H de Paula Figueiredo
On Wed, 29 Jan 2014 15:50:51 -0200, Mauricio Aldazosa  
 wrote:



Hi guys,


Hi!


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.


Well, I'd call that a Tapestry bug, but I'd also call that a very  
confusing naming of pages.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Mixup with page resolution

2014-01-29 Thread Mauricio Aldazosa
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