Re: double evaluation
Nathan Bubna <[email protected]>
| Newsgroups | gmane.comp.jakarta.velocity.user |
|---|---|
| Message-ID | <CAFyaDjG2Zb53G1un=vJ3UJKMY=4+3Ja1uSqDFwQs5Ype66C++Q@mail.gmail.com> |
Put the context in the context:
context.put("context", context);
Then do:
$context.get($id).content
On Fri, Jul 6, 2012 at 4:49 AM, <[email protected]> wrote:
> Hello Velocity Users,
>
> in our VelocityContext, there is a list called "sourceIds", which lists the available ids. In addition, there are HashMaps in the VelocityContext registered under the available ids. Maps are as many as ids, of course.
>
> So, for example we have: sourceIds = [src1, scr2] and therefore two maps src1 and src2 in the context.
>
> How can we refer to the map object?
>
> Using #foreach ( $id in $sourceIds ), first of all the String "src1" is the value of id ($id). But how can wie refer to the object stored under "src1" in the VelocityContext?
>
> $($id).getContent() did not work (it was (src).getContent()).
>
> Kind regards,
> Kieran
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>