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"]}

原文地址:https://www.cnblogs.com/wei1/p/9582124.html