Pass Array[][] of Strings to velocity and loop it

Hey guys,


I tried as follows:

String[][] retHours =  readResponseMessage(soapResponse);
contextMap.put("currentAXTimes", retHours);
return contextMap;


String[][] returnArray = null;

returnArray = new String [nodes.getLength()][2];
for (int i = 0; i < nodes.getLength(); i++)
     returnArray[i][0] = nodes.item(i).getAttributes().getNamedItem("Label").getNodeValue();
     returnArray[i][1] = nodes.item(i).getTextContent();

Example: retHours



In velocity Iam trying to print the values:

#foreach($axTimes in $currentAXTimes )
    <li>$axTimes[0] / $axTimes[1]</li>

Jira shows me the following String:

[Ljava.lang.String;@65d25310[0] / [Ljava.lang.String;@65d25310[1]
[Ljava.lang.String;@4b31f659[0] / [Ljava.lang.String;@4b31f659[1]

At least it gets the size of the array correctly (2), but somehow it wont show any values


Maybe you guys could give me some hints. Unfortunatelyjava is new for me.


Thanks in advance - Alex


0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

278 views 6 15
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot