标题:请高手帮我看一下,怎样获取Map中的值
取消只看楼主
五岳
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2010-11-24
结帖率:100%
 问题点数:0 回复次数:0 
请高手帮我看一下,怎样获取Map中的值
                <%
                        User user1 = new User(1,"tom1","111");
                        User user2 = new User(2,"tom2","222");
                        User user3 = new User(3,"tom3","333");
                        User user4 = new User(4,"tom4","444");
                        User user5 = new User(5,"tom5","555");
                        Map<String,User> map = new HashMap<String,User>();
                        map.put("user1",user1);
                        map.put("user2",user2);
                        map.put("user3",user3);
                        map.put("user4",user4);
                        map.put("user5",user5);
                        out.print(map);
                        pageContext.setAttribute("map",map);
                %>
                <br>
                <c:set target="${map }" property="user1"></c:set><br>
                <c:out value="${map }"></c:out><br>
                <c:out value="${map.property}"></c:out>
搜索更多相关主题的帖子: 111 222 
2011-05-10 22:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-339444-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.063634 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved