he method setAttribute(String,object)in the type HttpSession is not appl

来源:互联网 发布:大数据掌握的技术 编辑:程序博客网 时间:2024/06/08 02:27
这个错误的意思是你在绑定的时候,绑定的值不是一个Object,产生这个问题的原因主要是JDK版本的问题。有的JDK版本,是支持直接从int转换为Integer,编译可以通过。你的JDK应该不支持这个。解决的办法有两个:
方案一:忽略掉JDK版本,比如你原来是session.setAttribute("count",count);,count是int类型, 那你可以采用Integer countObj = Integer.valueOf(count);这样,在绑 定:session.setAttribute("countObj",countObj);
方案二:项目文件夹,右键,properties,Java Compiler 修改Compiler compliance lever 为1.6
0 0