![]() |
#2
hsh_19872010-07-22 16:57
|
在jsp页面中如何得到List和Map集合的值
我写的方法如下:
<%
Map map=new HashMap();
map.put("name1",new Integer(1));
map.put("age1","12");
map.put("password1","1234567");
%>
<%List Listname=new ArrayList();
for(int i=0;i<=10;i++){
Listname.add(i);
}%>
得到map的值是:${map.age1}
得到List的第一个值是${Listname[0]}
但是上面的两个值都得不到。如果换成map.get('age1')和Listname.get(0)是完全可以得到值
请问如何来解决这个问题。不要将集全的值放到内置对象中,这种方法不是得到集合的值,谢谢