You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joshua Long <lh...@adelphia.net> on 2005/04/04 16:33:55 UTC

Encoding a URL within a URL as a parameter

Whats the easiest way to encode a URL being passed as a paramter to
another url?


The assets retreived by the asset service. the url referenced in source
is created by a custom service. I need to the url into the first url. 

Anywya, i tried:

 cycle.getRequestContext().getResponse().encodeURL(link.getURL()); 

And that didn't quite work.. 

heres an example of the simplest fomr of the url 

 /myapp/xml_slide/myflashfile.swf?source=foo.xml

but instead of foo.xml, we want to pass in a dynamic url as generated by
a custom service, whose sample value is 

/myapp/app?service=m_service&sp=Sref_1005812745093696 

Anyway, thanks for any help. 

Joshua 


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


Re: Encoding a URL within a URL as a parameter

Posted by Markus Eberle <ma...@tngtech.com>.
Hi,

to simply encode the string use:

org.apache.commons.codec.net.URLCodec _urlCodec = new org.apache.commons.codec.net.URLCodec();
String encoded = _urlCodec.encode(dataToEncode, "UTF-8");

HTH
	Markus

On Monday 04 April 2005 16:33, Joshua Long wrote:
> Whats the easiest way to encode a URL being passed as a paramter to
> another url?
> 
> 
> The assets retreived by the asset service. the url referenced in source
> is created by a custom service. I need to the url into the first url. 
> 
> Anywya, i tried:
> 
>  cycle.getRequestContext().getResponse().encodeURL(link.getURL()); 
> 
> And that didn't quite work.. 
> 
> heres an example of the simplest fomr of the url 
> 
>  /myapp/xml_slide/myflashfile.swf?source=foo.xml
> 
> but instead of foo.xml, we want to pass in a dynamic url as generated by
> a custom service, whose sample value is 
> 
> /myapp/app?service=m_service&sp=Sref_1005812745093696 
> 
> Anyway, thanks for any help. 
> 
> Joshua 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 

-- 
TNG Technology Consulting GmbH
Tel: +49 179 148 24 16
markus.eberle@tngtech.com
http://www.tngtech.com

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