Rewriting index.html using LinkTransformer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rewriting index.html using LinkTransformer

Olaf Tomczak
Hello,

I recently migrated to Tapestry 5.2 and decided to re-implement
URLRewriter rules as LinkTransformers. Unfortunately there's a
problem. I have to rewrite all requests to *.html pages and route them
to my Index page (since the application was previously using html
pages and some users have it bookmarked). The
PageRenderLinkTransformer works for this purpose except for index.html
page. Since Index is a page name, requests to index.html are
automatically treated as component event requests (component html of
Index page) and are not passed through my transformer. Is there a way
to work around this issue?

Thank you,
Olaf Tomczak

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

Reply | Threaded
Open this post in threaded view
|

Re: Rewriting index.html using LinkTransformer

Thiago H de Paula Figueiredo
On Wed, 02 Feb 2011 07:04:54 -0200, Olaf Tomczak <[hidden email]>  
wrote:

> Hello,

Hi!

> I recently migrated to Tapestry 5.2 and decided to re-implement
> URLRewriter rules as LinkTransformers. Unfortunately there's a
> problem. I have to rewrite all requests to *.html pages and route them
> to my Index page (since the application was previously using html
> pages and some users have it bookmarked). The
> PageRenderLinkTransformer works for this purpose except for index.html
> page. Since Index is a page name, requests to index.html are
> automatically treated as component event requests (component html of
> Index page) and are not passed through my transformer. Is there a way
> to work around this issue?

I guess you hit a scenario which is not covered in LinkTransforms, as they  
only deal with event URL -> event URL and page URL -> page URL  
transformations, but not event URL (anything with a dot in it) -> page  
render URL nor vice-versa.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Rewriting index.html using LinkTransformer

Olaf Tomczak
Thiago,

2011/2/4 Thiago H. de Paula Figueiredo <[hidden email]>:

> On Wed, 02 Feb 2011 07:04:54 -0200, Olaf Tomczak <[hidden email]>
> wrote:
>
>> Hello,
>
> Hi!
>
>> I recently migrated to Tapestry 5.2 and decided to re-implement
>> URLRewriter rules as LinkTransformers. Unfortunately there's a
>> problem. I have to rewrite all requests to *.html pages and route them
>> to my Index page (since the application was previously using html
>> pages and some users have it bookmarked). The
>> PageRenderLinkTransformer works for this purpose except for index.html
>> page. Since Index is a page name, requests to index.html are
>> automatically treated as component event requests (component html of
>> Index page) and are not passed through my transformer. Is there a way
>> to work around this issue?
>
> I guess you hit a scenario which is not covered in LinkTransforms, as they
> only deal with event URL -> event URL and page URL -> page URL
> transformations, but not event URL (anything with a dot in it) -> page
> render URL nor vice-versa.

Thanks for confirming this for me. I've worked around the problem by
renaming "start page" to Main and creating PageRenderLinkTransformer
transforming /index to /main. I guess this works fine and does not
require using an external url rewriter.

Thanks,
Olaf Tomczak

>
> --
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

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