velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: Encode url
Date Thu, 18 Aug 2005 16:32:50 GMT
yeah, the encode URL method is not meant to escape key URL characters,
but rather to encode spaces and such to be URL-friendly.

if you want to escape key URL characters like '?', you will either
need to write your own method or find a utility.  you might try the
StringUtils class in commons-lang or something like that.

On 8/18/05, sliver <sliver@gmx.at> wrote:
> Hi,
> 
> how do I encode a string in velocity?
> 
> I tried this
> 
> #set( $encodedStr = $link.encodeURL($string))
> 
> but it doesn't encode characters like '?' and '&'. I need them to put a URL
> into a parameter of a request string.
> 
> e.g.
> http://foo.bar.org/some.action?backurl=another.action?foo=bar&bar=foo
> 
> where backurl should be another.action?foo=bar&bar=foo
> 
> TIA
> Stefan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

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


Mime
View raw message