You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alex Kotchnev <ak...@gmail.com> on 2012/09/05 22:22:18 UTC

Re: No 404 error is raised

This is quite a pesky problem. I tried going w/ the Start page approach
mentioned in
https://issues.apache.org/jira/browse/TAP5-879?attachmentOrder=desc  ;
however, as it appears the approach w/ Start pages no longer works (and
they're deprecated anyway). It certainly is a surprise when the app never
returns a 404 and always sends the user to the index page, but it's not a
terrible surprise as the user gets to see a real page with content .

I'll look forward to the 5.4 solution.

Cheers,

Alex K

On Mon, Aug 20, 2012 at 9:36 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Mon, 20 Aug 2012 19:18:30 -0300, Howard Lewis Ship <hl...@gmail.com>
> wrote:
>
>  I'm considering a change for Tapestry 5.4 where the ValueEncoder,
>> responsible for converting portions of the URL into the page
>> activation context, will have a new method that defines what it
>> expects to see in its portion of the URL, in terms of a regular
>> expression.
>>
>
> Shouldn't we have a different encoder specific for URLs (with ValueEncoder
> as a fallback) and leave ValueEncoder more focused on dealing with form
> fields? This way, we can handle this validation without changing
> ValueEncoder.
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: No 404 error is raised

Posted by Alejandro Scandroli <al...@gmail.com>.
Alex, as a workaround for almost the same issue I wrote this module:
https://gist.github.com/3360101
It accomplishes three things:

*) The default PageRenderDispatcher will skip Index pages.
*) There is a new Dispatcher that will deal with the Index pages but
it's configured after all the other dispatchers with "after:*"
*) This new Dispatcher mandates that Index pages MUST NOT have a
context. It forces EMPTY_CONTEXT on the Index pages.

if you feel adventurous enough you can try it out and see if it fits your needs.

I hope it helps
Alejandro.


On Wed, Sep 5, 2012 at 10:30 PM, Kalle Korhonen
<ka...@gmail.com> wrote:
> On Wed, Sep 5, 2012 at 1:22 PM, Alex Kotchnev <ak...@gmail.com> wrote:
>> This is quite a pesky problem. I tried going w/ the Start page approach
>> mentioned in
>> https://issues.apache.org/jira/browse/TAP5-879?attachmentOrder=desc  ;
>> however, as it appears the approach w/ Start pages no longer works (and
>> they're deprecated anyway). It certainly is a surprise when the app never
>> returns a 404 and always sends the user to the index page, but it's not a
>> terrible surprise as the user gets to see a real page with content .
>
> Try tapestry-routing (http://tynamo.org/tapestry-routing+guide) with a
> Home page and @Route("/") rule plus no Index pages. That should give
> you the expected behavior.
>
> Kalle
>
>
>> On Mon, Aug 20, 2012 at 9:36 PM, Thiago H de Paula Figueiredo <
>> thiagohp@gmail.com> wrote:
>>
>>> On Mon, 20 Aug 2012 19:18:30 -0300, Howard Lewis Ship <hl...@gmail.com>
>>> wrote:
>>>
>>>  I'm considering a change for Tapestry 5.4 where the ValueEncoder,
>>>> responsible for converting portions of the URL into the page
>>>> activation context, will have a new method that defines what it
>>>> expects to see in its portion of the URL, in terms of a regular
>>>> expression.
>>>>
>>>
>>> Shouldn't we have a different encoder specific for URLs (with ValueEncoder
>>> as a fallback) and leave ValueEncoder more focused on dealing with form
>>> fields? This way, we can handle this validation without changing
>>> ValueEncoder.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: No 404 error is raised

Posted by Kalle Korhonen <ka...@gmail.com>.
On Wed, Sep 5, 2012 at 1:22 PM, Alex Kotchnev <ak...@gmail.com> wrote:
> This is quite a pesky problem. I tried going w/ the Start page approach
> mentioned in
> https://issues.apache.org/jira/browse/TAP5-879?attachmentOrder=desc  ;
> however, as it appears the approach w/ Start pages no longer works (and
> they're deprecated anyway). It certainly is a surprise when the app never
> returns a 404 and always sends the user to the index page, but it's not a
> terrible surprise as the user gets to see a real page with content .

Try tapestry-routing (http://tynamo.org/tapestry-routing+guide) with a
Home page and @Route("/") rule plus no Index pages. That should give
you the expected behavior.

Kalle


> On Mon, Aug 20, 2012 at 9:36 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> On Mon, 20 Aug 2012 19:18:30 -0300, Howard Lewis Ship <hl...@gmail.com>
>> wrote:
>>
>>  I'm considering a change for Tapestry 5.4 where the ValueEncoder,
>>> responsible for converting portions of the URL into the page
>>> activation context, will have a new method that defines what it
>>> expects to see in its portion of the URL, in terms of a regular
>>> expression.
>>>
>>
>> Shouldn't we have a different encoder specific for URLs (with ValueEncoder
>> as a fallback) and leave ValueEncoder more focused on dealing with form
>> fields? This way, we can handle this validation without changing
>> ValueEncoder.
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>

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