当前位置: 技术问答>java相关
有关session中的getAttribute(java.lang.String name)的问题???
来源: 互联网 发布时间:2015-06-23
本文导语: a.jsp中 ..... HttpSession userDataVessle = request.getSession(true); int id = request.getParameter("ID"); userDataVessle.setAttribute("id",new Integer(id)); ..... 如何在另一个页面里得到int id??? public java.lang.Object getAttribute(java.lang.String name) java....
a.jsp中
.....
HttpSession userDataVessle = request.getSession(true);
int id = request.getParameter("ID");
userDataVessle.setAttribute("id",new Integer(id));
.....
如何在另一个页面里得到int id???
public java.lang.Object getAttribute(java.lang.String name)
java.lang.Object 如何转换成int????????
多谢!!
.....
HttpSession userDataVessle = request.getSession(true);
int id = request.getParameter("ID");
userDataVessle.setAttribute("id",new Integer(id));
.....
如何在另一个页面里得到int id???
public java.lang.Object getAttribute(java.lang.String name)
java.lang.Object 如何转换成int????????
多谢!!
|
Integer id = session.getAttribute("id");
改为
Integer id = (Integer)session.getAttribute("id");
改为
Integer id = (Integer)session.getAttribute("id");