BoD wrote:
So I would need something like eval($expr) that would evaluate the
content of $expr which is $obj.getProp(). Obj being declared before
it would call the method and return "hello".
You might be interested in RenderTool, a component of the VelocityTools
package. Its eval() method is particularly useful:
http://jakarta.apache.org/velocity/tools/generic/RenderTool.html#eval()
Example code:
#set( $list = [1,2,3] )
#set( $object = '$list' )
#set( $method = 'size()' )
$render.eval($ctx, "${object}.$method")
Example output:
3
Or, in your case, you would use $render.eval($ctx, $expr) to do what you
need.
Shane
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]