You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "tapestry@bg.cdev.de" <ta...@bg.cdev.de> on 2011/06/04 00:49:13 UTC

PageRenderLinkTransformer and rewriting urls for root requests

Hello,
I'm trying to use the PageRenderLinkTransformer to rewrite my urls but it
doesn't seem to be the right way for my case. The problem is that the
decodePageRenderRequest method isnt invoked when I request the root without a
page name. I would like to rewrite dynamically urls by the requested subdomain.
e.g. myparameter.domain.com/  to domain.com/Page/myparameter

Has anyone an idea? Did I something wrong? The URLRewriterRule would work but
its deprecated...

Thank you.

Regards,
Jan Reinhard

Re: PageRenderLinkTransformer and rewriting urls for root requests

Posted by "tapestry@bg.cdev.de" <ta...@bg.cdev.de>.
Thank you for the information. Now I am using an own RequestFilter which
rewrites the path from "/" to "/Index" when needed. After that the
LinkTransformer works. Better to use this little hack rather than the deprecated
urlrewriter.
 
Thanks,
Jan


"Thiago H. de Paula Figueiredo" <th...@gmail.com> hat am 5. Juni 2011 um
22:04 geschrieben:

> On Sun, 05 Jun 2011 15:17:24 -0300, tapestry@bg.cdev.de 
> <ta...@bg.cdev.de> wrote:
>
> > Thank you for your reply. As mentioned, I tried to use the
> > PageRenderLinkTransformer which is part of the LinkTransformer API
> > (LinkTransformer extends ComponentEventLinkTransformer,
> > PageRenderLinkTransformer). The problem is that the decode method isn't 
> > invoked when the root page is requested (without the name of the root 
> > page). So I can't rewrite requests for "/". Is this a feature or a bug? 
> > :-) Or did I something wrong?
>
> I recall having seen this same issue before. "/" is handled by a different 
> Dispactcher than the one the handles other requests. You can use the old 
> URL rewriting API or create a RequestFilter that passes a different 
> Request to the next in the chain (which is exactly how the old URL 
> rewriting code works).
>
> --
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: PageRenderLinkTransformer and rewriting urls for root requests

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 05 Jun 2011 15:17:24 -0300, tapestry@bg.cdev.de  
<ta...@bg.cdev.de> wrote:

> Thank you for your reply. As mentioned, I tried to use the
> PageRenderLinkTransformer which is part of the LinkTransformer API
> (LinkTransformer extends ComponentEventLinkTransformer,
> PageRenderLinkTransformer). The problem is that the decode method isn't  
> invoked when the root page is requested (without the name of the root  
> page). So I can't rewrite requests for "/". Is this a feature or a bug?  
> :-) Or did I something wrong?

I recall having seen this same issue before. "/" is handled by a different  
Dispactcher than the one the handles other requests. You can use the old  
URL rewriting API or create a RequestFilter that passes a different  
Request to the next in the chain (which is exactly how the old URL  
rewriting code works).

-- 
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: PageRenderLinkTransformer and rewriting urls for root requests

Posted by "tapestry@bg.cdev.de" <ta...@bg.cdev.de>.
Thank you for your reply. As mentioned, I tried to use the
PageRenderLinkTransformer which is part of the LinkTransformer API
(LinkTransformer extends ComponentEventLinkTransformer,
PageRenderLinkTransformer). The problem is that the decode method isn't invoked
when the root page is requested (without the name of the root page). So I can't
rewrite requests for "/". Is this a feature or a bug? :-) Or did I something
wrong?

Regards,
Jan Reinhard






"Thiago H. de Paula Figueiredo" <th...@gmail.com> hat am 5. Juni 2011 um
14:43 geschrieben:

> On Fri, 03 Jun 2011 19:49:13 -0300, tapestry@bg.cdev.de 
> <ta...@bg.cdev.de> wrote:
>
> > Hello,
>
> Hi!
>
> > I'm trying to use the PageRenderLinkTransformer to rewrite my urls but it
> > doesn't seem to be the right way for my case. The problem is that the
> > decodePageRenderRequest method isnt invoked when I request the root 
> > without a
> > page name. I would like to rewrite dynamically urls by the requested 
> > subdomain.
> > e.g. myparameter.domain.com/  to domain.com/Page/myparameter
> >
> > Has anyone an idea? Did I something wrong? The URLRewriterRule would 
> > work but its deprecated...
>
> Use the LinkTransformer API. It's the replacement of URL rewriter.
>
> --
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: PageRenderLinkTransformer and rewriting urls for root requests

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 03 Jun 2011 19:49:13 -0300, tapestry@bg.cdev.de  
<ta...@bg.cdev.de> wrote:

> Hello,

Hi!

> I'm trying to use the PageRenderLinkTransformer to rewrite my urls but it
> doesn't seem to be the right way for my case. The problem is that the
> decodePageRenderRequest method isnt invoked when I request the root  
> without a
> page name. I would like to rewrite dynamically urls by the requested  
> subdomain.
> e.g. myparameter.domain.com/  to domain.com/Page/myparameter
>
> Has anyone an idea? Did I something wrong? The URLRewriterRule would  
> work but its deprecated...

Use the LinkTransformer API. It's the replacement of URL rewriter.

-- 
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org