You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Vinod Shintre <vs...@definee.com> on 2009/04/27 08:05:54 UTC

linktool relative path bug

Velocity1.6.2 & velocity-tools-2.0-beta3 linktool url encoding 

 

$link.relative('XXX/XXX.jsp?do=list&type=fav')

 

Is url encoding the ? part 

 

Ex: buggy output -> http://server/XXX.jsp%3Fdo=list&type=fav

 

 

 Vinod Shintre,
vshintre@definee.com, # 9886123278 |  <http://www.definee.com/>
www.definee.com |  <http://www.attribo.com> www.attribo.com 


 

email disclaimer  <http://www.definee.com/mail-disclaimer.txt>
http://www.definee.com/mail-disclaimer.txt

 


Re: linktool relative path bug

Posted by Nathan Bubna <nb...@gmail.com>.
If you want the ? to be part of the path and not part of the query
data, then yes, it must be encoded.  Things have changed with
LinkTool.  the relative() method is for setting path data.  if you
want to set query data, you should use the query() (to set the query
string) or params() (to add to the query string) methods.  if you
really want to set both at once, then you should do
$link.uri('XXX/XXX.jsp?do=list&type=fav'), or if you want to ensure it
is relative, do:

$link.uri('XXX/XXX.jsp?do=list&type=fav').relative()

Sorry for any inconvenience the changes have caused, but the new
LinkTool approach is much superior in terms of a) not requiring
servlet api  b) being consistent  and c) sheer options available.

If you were using the deprecated
org.apache.velocity.tools.view.tools.LinkTool (i.e. the old one) then
please make that clear.  In that case, i'll consider hacking a "keep
it as it was" fix into that specific class.  I'm just assuming since
you are using 2.0-beta3 and didn't say otherwise, that you are using
the new version.  If you're not sure which you are using, then do
$link.class to find out. :)

On Sun, Apr 26, 2009 at 11:05 PM, Vinod Shintre <vs...@definee.com> wrote:
> Velocity1.6.2 & velocity-tools-2.0-beta3 linktool url encoding
>
>
>
> $link.relative('XXX/XXX.jsp?do=list&type=fav')
>
>
>
> Is url encoding the ? part
>
>
>
> Ex: buggy output -> http://server/XXX.jsp%3Fdo=list&type=fav
>
>
>
>
>
>  Vinod Shintre,
> vshintre@definee.com, # 9886123278 | www.definee.com | www.attribo.com
>
>
>
> email disclaimer http://www.definee.com/mail-disclaimer.txt
>
>

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