On Mon, Apr 4, 2011 at 12:08 PM, Thiago H. de Paula Figueiredo
<[email protected]> wrote:
> On Mon, 04 Apr 2011 14:29:26 -0300, Howard Lewis Ship <[email protected]>
> wrote:
>
>> @MatchExtraPath("\\d+")
>> public class Index
>> {
>> }
>
> I prefer another approach: according to my experience, it's rare to have an
> Index page with activation context parameters. Thus, I think we can create a
> mixin that raises a 404 when page activation context is not empty,
> automatically apply it to all Index pages and have a configuration symbol to
> configure this, most probably with a false default value to provide
> backwards compatibility.

This may be true at the root level, but I often create index pages in
subpackages for this purpose, i.e. root.pages.user.UserIndex that has
a page activation context that's a user id.  The typical URL will be
"/user/12345" but an errant CSS rule or relative URL to an image can
result in "/user/images/icon.png" and a NumericFormatException trying
to convert "images" to a Long (before accessing the User).

>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to