el表达式取复杂map数组的值
1.对于Map<Integer,Object> 结构类似于map中嵌套map类型
Map<Integer,Object> map1=new HashMap<...>()
Map<Integer,String> map2=new HashMap<...>()
Map<Integer,String> map3=new HashMap<...>()
map2.put(1,"a");
map2.put(2,"b");
map1.put(3,map2);
map1.put(4,map3);
如果想取得map2中的值"a",可以这样写${map1[3][1]}其中 []中是map的键,它一定要与当时声明的map的键类型一致,Integer类型的不能写成String类型的,同样string类型的也不能写成Integer类型的,否则页面取不到值
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: Vue入门 - 条件渲染与列表渲染
- 下一篇: JSP EL表达式获取数据