You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "squallmat ." <sq...@gmail.com> on 2014/09/09 15:03:26 UTC

url rewriting on href

Hi,

I have url stored in DB, like "www.google.com" and I just pass them in my
template to an href attribute, like this :

<t:Loop t:source="urls" t:value="url">
- <a href="${url}" target="_blank">${url}</a>
<br />
</t:Loop>

The value of ${url} in the href attribute is rewrote to concatenate the
actual displayed page url. Why is there url rewriting here ? And how can I
disable it ?

Re: url rewriting on href

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 09 Sep 2014 10:26:00 -0300, squallmat . <sq...@gmail.com>  
wrote:

> Ah ok yes, nothing to see with tapestry. Many of the url are entered by
> user and then many of them don't have the http:// appended at beginning.  
> I need to rewrite them, or is there a way in html to make all <a href>  
> tags
> to be read as absolute by the browser ?

You'll need to process them yourself before passing it to Tapestry.

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

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


Re: url rewriting on href

Posted by "squallmat ." <sq...@gmail.com>.
Ah ok yes, nothing to see with tapestry. Many of the url are entered by
user and then many of them don't have the http:// appended at beginning. I
need to rewrite them, or is there a way in html to make all <a href> tags
to be read as absolute by the browser ?


2014-09-09 15:12 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Tue, 09 Sep 2014 10:03:26 -0300, squallmat . <sq...@gmail.com>
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>
>
>> I have url stored in DB, like "www.google.com" and I just pass them in my
>> template to an href attribute, like this :
>>
>> <t:Loop t:source="urls" t:value="url">
>> - <a href="${url}" target="_blank">${url}</a>
>> <br />
>> </t:Loop>
>>
>> The value of ${url} in the href attribute is rewrote to concatenate the
>> actual displayed page url. Why is there url rewriting here ? And how can
>> I disable it ?
>>
>
> Tapestry itself doesn't rewrite anything you include in the template
> through ${} expansions. Have you checked what's really in the generated
> HTML for that attribute or you just hovered the mouse over it? Remember:
> browsers usually consider anything which doesn't start with 'http://',
> 'https://' or '/' as local, relative URLs.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: url rewriting on href

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 09 Sep 2014 10:03:26 -0300, squallmat . <sq...@gmail.com>  
wrote:

> Hi,

Hi!

>
> I have url stored in DB, like "www.google.com" and I just pass them in my
> template to an href attribute, like this :
>
> <t:Loop t:source="urls" t:value="url">
> - <a href="${url}" target="_blank">${url}</a>
> <br />
> </t:Loop>
>
> The value of ${url} in the href attribute is rewrote to concatenate the
> actual displayed page url. Why is there url rewriting here ? And how can  
> I disable it ?

Tapestry itself doesn't rewrite anything you include in the template  
through ${} expansions. Have you checked what's really in the generated  
HTML for that attribute or you just hovered the mouse over it? Remember:  
browsers usually consider anything which doesn't start with 'http://',  
'https://' or '/' as local, relative URLs.

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

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