You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by carlo latasa <cl...@gmail.com> on 2008/12/06 00:57:28 UTC

Hacking Old Tags...

So I'm trying to support the old Velocity Tag format listed here:
http://cwiki.apache.org/WW/velocity-tags-old.html
using the latest Struts and Velocity jars.

One very janky way of doing it (maybe) is to implement a macro like this:

#macro(tag $type $label $name $size $ref )....

then just switch on the type and either call the existing #s type tags or if
it's a Component then include the $ref .vm.

The first issue is how to pass a parameter ($type in this case) to a macro
that isn't in quotes.

If your asking yourself "why is this guy trying to do this???!!!" it's
because I have hundreds and hundreds of existing .vm pages that all use the
Old tag format and I don't want to mess with them.

Thanks,

Carlo.

Re: Hacking Old Tags...

Posted by Nathan Bubna <nb...@gmail.com>.
This is probably a question best asked of the Struts 2/WebWork lists.
I'm not aware of any of those developers (who would know best) being
on this list.

But to answer your question, you can't pass a parameter that isn't
either in quotes or a $ref.  You would have to create your own
Directive to do that.

On Fri, Dec 5, 2008 at 3:57 PM, carlo latasa <cl...@gmail.com> wrote:
> So I'm trying to support the old Velocity Tag format listed here:
> http://cwiki.apache.org/WW/velocity-tags-old.html
> using the latest Struts and Velocity jars.
>
> One very janky way of doing it (maybe) is to implement a macro like this:
>
> #macro(tag $type $label $name $size $ref )....
>
> then just switch on the type and either call the existing #s type tags or if
> it's a Component then include the $ref .vm.
>
> The first issue is how to pass a parameter ($type in this case) to a macro
> that isn't in quotes.
>
> If your asking yourself "why is this guy trying to do this???!!!" it's
> because I have hundreds and hundreds of existing .vm pages that all use the
> Old tag format and I don't want to mess with them.
>
> Thanks,
>
> Carlo.
>

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