You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Moritz Gmelin <mo...@gmx.de> on 2008/01/28 09:41:22 UTC

URL-Stripping in 5.0.9 leads to incorrect URLs

Hi,

I just tried to update to the 5.0.9 Release version and found some  
strange behaviour.

I have a dynamically created image from a service on my page.

The method to create the link is as follows
	 public Link getBPURL(){
         	return getResources().createActionLink("BPGraph", false, new  
Object[] { });
  	}
		
This is how the .tml part looks
    	<img id="bpimg" class="dia_img" src="${BPURL}" width="800"  
height="400"/>

And this is the resulting html code
	<img class="dia_img" height="400" id="bpimg" src="databp:BPGraph"  
width="800">

The browser refuses to render an image since it considers the URL  
"databp:BPGraph" as invalid (which I can somehow understand).

If I add a dummy parameter in the method that creates the Link
  	public Link getBPURL(){
         	return getResources().createActionLink("BPGraph", false, new  
Object[] { 1 });
  	}
the rendered html looks like this
	<img class="dia_img" height="400" id="bpimg" src="./databp:BPGraph/1"  
width="800">

This is OK for my browser. But I would consider it a but in the way  
tapestry (since 5.0.8) shortens the URLs.

Shall I use the workaround to add a dummy parameter or will this be  
fixed?

Thanks

Moritz




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


Re: URL-Stripping in 5.0.9 leads to incorrect URLs

Posted by Kevin Menard <km...@servprise.com>.
You should file a JIRA for your particular use case.  The URL optimization
stuff had been beaten on pretty hard, though, so you shouldn't run into
issues in the general case.

In the meanwhile, you can control the behavior of the URL generation.  To
use the old format, add the following:

configuration.add(TapestryConstants.FORCE_ABSOLUTE_URIS_SYMBOL, "true");

to your contributeApplicationDefaults(MappedConfiguration<String, String>
configuration) in your AppModule.

-- 
Kevin


On 1/28/08 3:41 AM, in article 14D05C42-BAAF-40F5-BAD3-B814DF1F1F6F@gmx.de,
"Moritz Gmelin" <mo...@gmx.de> wrote:

> Hi,
> 
> I just tried to update to the 5.0.9 Release version and found some
> strange behaviour.
> 
> I have a dynamically created image from a service on my page.
> 
> The method to create the link is as follows
> public Link getBPURL(){
> return getResources().createActionLink("BPGraph", false, new
> Object[] { });
> }
> 
> This is how the .tml part looks
> <img id="bpimg" class="dia_img" src="${BPURL}" width="800"
> height="400"/>
> 
> And this is the resulting html code
> <img class="dia_img" height="400" id="bpimg" src="databp:BPGraph"
> width="800">
> 
> The browser refuses to render an image since it considers the URL
> "databp:BPGraph" as invalid (which I can somehow understand).
> 
> If I add a dummy parameter in the method that creates the Link
> public Link getBPURL(){
> return getResources().createActionLink("BPGraph", false, new
> Object[] { 1 });
> }
> the rendered html looks like this
> <img class="dia_img" height="400" id="bpimg" src="./databp:BPGraph/1"
> width="800">
> 
> This is OK for my browser. But I would consider it a but in the way
> tapestry (since 5.0.8) shortens the URLs.
> 
> Shall I use the workaround to add a dummy parameter or will this be
> fixed?
> 
> Thanks
> 
> Moritz
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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