获取session中的所有值并打印
作者:互联网
问题:在debugger中下拉框数据获取不到,主要原因session中的id为空,故想打印session中所有值看看
HttpSession session = request.getSession();
Enumeration enumeration = session.getAttributeNames();
while (enumeration.hasMoreElements()){
String name = enumeration.nextElement().toString();
Object value = request.getSession().getAttribute(name);
System.out.println(name+":"+value);
}
标签:并打印,getSession,name,request,enumeration,获取,session,value 来源: https://www.cnblogs.com/polatu/p/15166157.html