You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by David Sperling <ve...@hakodateit.com> on 2006/03/03 15:57:00 UTC

velocity-tools-1.2 linkTool module support

Hi-

I was reading the changlog for velocity-tools-1.1 and it said that:
   * Refactor StrutsUtils to use Struts 1.1 classes and support modules
(maj)

I was wondering if this included a module switch function for linkTool.
Right now I'm doing this to switch modules with linkTool:

<ahref="$link.setAction("toModule").addQueryData("prefix","/customer").addQueryData("page","/admin/listCustomers.do").addQueryData("id","$user.id").addQueryData("list","true")">customers</a>

but it is very messy.  : (

Is there a function similar to the Struts link tag available?
<html:link module="/moduleB" path="/index.do"/>


Cheers,

David

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


Re: velocity-tools-1.2 linkTool module support

Posted by David Sperling <ds...@hakodateit.com>.
David Sperling wrote:

>Hi-
>
>I was reading the changlog for velocity-tools-1.1 and it said that:
>   * Refactor StrutsUtils to use Struts 1.1 classes and support modules
>(maj)
>
>I was wondering if this included a module switch function for linkTool.
>Right now I'm doing this to switch modules with linkTool:
>
><ahref="$link.setAction("toModule").addQueryData("prefix","/customer").addQueryData("page","/admin/listCustomers.do").addQueryData("id","$user.id").addQueryData("list","true")">customers</a>
>
>but it is very messy.  : (
>
>Is there a function similar to the Struts link tag available?
><html:link module="/moduleB" path="/index.do"/>
>
>
>Cheers,
>
>David
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>  
>
Answering my own question.
StrutsLinkTool extends linkTool.  So  I tried out the following
and it works fine and is much cleaner.

<ahref="$link.setRelative("mymodule/admin/listCustomers.do").addQueryData("id","$user.id").addQueryData("list","true")">customers</a>
This may even be easier than adding a module param, like is done with
the Struts "html link tag".


Cheers,

David

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