最佳答案:可以,只不过是取值时要转换成相应的类型.比如数组session.setAttribute("str", new String[]{"a","b"});/
可以,只不过是取值时要转换成相应的类型.
比如数组
session.setAttribute("str", new String[]{"a","b"});
//取值时转换成相应对象类型即可
String str=(String) session.getAttribute("str");