velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter_F...@blm.gov
Subject Re: creating references to arbitrary hashtable
Date Mon, 27 Oct 2008 15:34:11 GMT
If "slots" is a Map object, try:

$slots.get("foo")


"Robert Huffstedtler" <rhuffstedtler@ironworks.com> wrote on 10/27/2008
09:27:26 AM:

> Hi folks -
>
>
>
> I am helping a group migrate some content from Coldfusion to Velocity.
> In their CF code, they have a custom tag which they use in individual
> pages for grouping commonly used page variables into a pseudo-object
> before passing it off to the page wrapper.  The model is very similar to
> the use of the VelocityLayoutServlet, so that's the direction I'm going
> for the migration.
>
>
>
> However, trying to set properties on a VTL identifier does not seem to
> work if the identifier does not reference an object.  The documentation
> does not make it clear that that is a requirement
> (http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
> #references).  The description of properties implies that one can
> associate a VTL identifier with a hashtable, but there aren't clear
> directions for doing so.
>
>
>
> Putting this -
>
>
>
> #set ( $slots.foo = "Foo")
>
>
>
> In my index.vm and referencing it like this in my Default.vm:
>
>
>
> $slots.foo<br/>
>
>
>
> Is just resulting in $slots.foo being output as a literal.
>
>
>
> Can someone point me in the right direction here?
>
>
>


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


Mime
View raw message