DBID现在是int类型的啊,我用session.setAttribute("DBID",DBID); <-------------------------------> *** Error: No match was found for method "setAttribute(java.lang.String, int)".
非常感谢freefalcon(心宇),高手啊。 另外想请教一下,在接受页,怎么取出session值给变量呢? 我用String se1 = session.getAttribuet("DBID"); 总是报错<---------------------------------> *** Error: The type of the left-hand side in this assignment, "java/lang/String", is not compatible with the type of the right-hand side expression, "java/lang/Object". 汗~~~~~
<------------------------------->
*** Error: No match was found for method "setAttribute(java.lang.String, int)".
或
session.setAttribute("DBID",new Integer(DBID));
等等
不能是基本类型
另外想请教一下,在接受页,怎么取出session值给变量呢?
我用String se1 = session.getAttribuet("DBID");
总是报错<--------------------------------->
*** Error: The type of the left-hand side in this assignment, "java/lang/String", is not compatible with the type of the right-hand side expression, "java/lang/Object".
汗~~~~~
先用session.setAttribute("coId",String.valueOf(coID));
再用String dbid = String.valueOf(session.getAttribute("coId"));转换回来,呵呵,多谢了~~~