运行jsp的session出错
voidsetsession(){Integerid=newInteger(1);Stringname="abu";Stringcountry="china";Listl...
void setsession(){
Integer id = new Integer(1);
String name = "abu";
String country = "china";
List list = new ArrayList();
list.add(id);
list.add(name);
list.add(country);
session.setAttribute("hebendong",list);
}
调用上面的代码出现以下错误:
java.lang.NullPointerException
view.login.composer.GetLogin.setsession(GetLogin.java:47)
view.login.composer.GetLogin.doGet(GetLogin.java:107)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
不知道是什么问题,请各位大哥帮忙看一下,小弟感谢不尽...! 展开
Integer id = new Integer(1);
String name = "abu";
String country = "china";
List list = new ArrayList();
list.add(id);
list.add(name);
list.add(country);
session.setAttribute("hebendong",list);
}
调用上面的代码出现以下错误:
java.lang.NullPointerException
view.login.composer.GetLogin.setsession(GetLogin.java:47)
view.login.composer.GetLogin.doGet(GetLogin.java:107)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
不知道是什么问题,请各位大哥帮忙看一下,小弟感谢不尽...! 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询