迭代JSP中的关联数组

时间:2013-12-27 15:39:00

标签: jsp loops foreach associative-array

这就是我所拥有的     myarray = [[value:32423412412,key:Home],[value:12312323123,key:Other],[value:12312313232,key:Other],[value:23423523523,key:Work],[value:1312321,key:工作]]

我如何迭代并获得所有价值和关键? 感谢

1 个答案:

答案 0 :(得分:0)

<%
arraySize = myarray.size;
for(def i=0; i<arraySize; i++)
{
   def phone = myarray[i]["value"];
   def type = myarray[i]["key"];
}
%>