velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mclai <>
Subject #evaluate directive
Date Fri, 17 Aug 2007 08:01:05 GMT

The following code is found in velocity user guide :

#set($source1 = "abc")
#set($select = "1")
#set($dynamicsource = "$source$select")

It is supposed to print "abc" according to the user guide but in fact, the
result to me is that it prints: 

The above code doesn't work for me.  Do I miss something?

I am very new to velocity and I know it is a silly question.  Could anyone
kindly tell me why I have different result and how could I correctly use
#evaluate directive to print the right answer?

However, if I changed to use ViewRenderTool for VTL evaluation, it will
print "abc" as expected.   Is #evaluate no longer to work?  I guess I must
miss some major steps in order to make #evaluate work.  Please post if
someone knows why.  Thank you.  The following is the working VTL which uses

#set($source1 = "abc")
#set($select = "1")
#set($dynamicsource = "$source$select")

View this message in context:
Sent from the Velocity - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message