Hashmap and Arraylist in Velocity

Description
dbosman
Posts: 6
Joined: Wed Feb 08, 2017 10:16 am

Hashmap and Arraylist in Velocity

Postby dbosman » Mon Feb 27, 2017 9:19 am

On

http://velocity.apache.org/engine/1.7/user-guide.html

an example is showed how to use maps and lists in Velocity:

#set( $monkey.Say = ["Not", $my, "fault"] ) ## ArrayList
#set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"}) ## Map

Unfortunately this does not work in 2016 SR1.

1. Which Velocity version is Polarion 2016 SR1 using?

I tried the following workaround:

1.doc: $document <BR>
2.dc: $document.getClass() <BR>
3.class: $document.getClass().forName("java.util.ArrayList") <BR>
4.lst: $document.getClass().forName("java.util.ArrayList").newInstance() <BR>

Unfortunately step 3 fails.

How does one create a ArrayList or HashMap in Velocity?

Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 2 guests