velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <>
Subject Indirect references
Date Fri, 08 Aug 2003 18:11:00 GMT
This may sound odd, but, if it were possible, I'd like to do a bit of 
indirection in my variable references.

The use case is this: I have a list in the context. The list may end up 
under one name or another, but I do know what the list's name is before 
I forward to the template. I'd like the template to set a local variable 
to the list based on the name that I pass inside of another variable.

Essentially, something like this:

#set($list = ${$listname})

where I've already something like has already been done (in one place or 


... later ...


and have $list be a pointer to list in the first statement.



Ted Husted,
   Junit in Action  - <>,
   Struts in Action - <>,
   JSP Site Design  - <>.

View raw message