struts中的迭代器如何和遍历Map中的List集合
Map<string,list>mp=newHashMap<String,List>();Listpersons=newArrayList();Personp1=newP...
Map<string,list>mp = new HashMap<String, List>(); Listpersons = new ArrayList(); Person p1 = new Person(); p1.setId(1); p1.setName("takahashi"); Person p2 = new Person(); p1.setId(2); p1.setName("maeda"); Person p3 = new Person(); p1.setId(3); p1.setName("mayuyu"); Person p4 = new Person(); p1.setId(4); p1.setName("yukirin"); persons.add(p1); persons.add(p2); persons.add(p3); persons.add(p4); mp.put("persons", persons); ActionContext.getContext().put("mp", mp); return SUCCESS;</string,list
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询