Jsp获得Map中map.put("2", "bb");此类的value值

<%--获取Map中的数据 --%>
	<%
		Map<String, String> map = new HashMap<String, String>();
		map.put("a", "aa");
		map.put("2", "bb");
		map.put("3", "cc");
		pageContext.setAttribute("map", map);
	%><br> Map1:${map.a}
	<br> Map2:${map["2"] }

如果Map中的key时“2”这样的String,就不可以使用${map.2}来得到了,需要使用

 Map2:${map["2"] }
来得到,下面的Accept-Encoding也是需要这样得到
${hander["Accept-Encoding"]}

posted @ 2018-02-28 20:04  wei1  阅读(1459)  评论(0编辑  收藏  举报