linktool relative path bug

View: New views
2 Messages — Rating Filter:   Alert me  

linktool relative path bug

by Vinod Shintre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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@..., # 9886123278 | www.definee.com | www.attribo.com

 

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

 


Re: linktool relative path bug

by Nathan Bubna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <vshintre@...> 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@..., # 9886123278 | www.definee.com | www.attribo.com
>
>
>
> email disclaimer http://www.definee.com/mail-disclaimer.txt
>
>

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