ultiple annotations found at this line:
- The method parse(Object) is undefined for the type
Integer
- The method parse(Object) is undefined for the type
Integer
你的方法有这样的问题 我说的对象是request对象
对了 你猜的也对 牛》》》》》》》
下面这个的转换类型要哪个 (List)这个有问题Type safety: Unchecked cast from Object to List
List ListB=(List)request.getAttribute("ListBean");
你这个应该是“泛型”有点问题吧 也就是list 尖括号里面的东西 这个东西不看上下文的话 真不好弄 单看你这个类型转换的语句 应该是没问题的 不加泛型的话就是
List listb=(List)request.getAttribute("ListBean");
另外提醒你一句 变量的名字首字母不要大写 这个习惯要改正。
我的servlet是这样的
List ListBean=new ArrayList();
request.setAttribute("ListBean", ListBean);
RequestDispatcher RD=request.getRequestDispatcher("Indext.jsp");
RD.forward(request, response);
就是到页面时 List ListB=(List)request.getAttribute("ListBean");
这个出问题了
能给你QQ不?
看语法真没什么问题 强制转换里面的泛型也加上了 我感觉没加才能出这个错误 你加上了应该就没有了 保存一下试试 是不是还有红叉 再有错 我就真解释不了了 我也是正在学 哈哈 其实也比你强不了多少 我的QQ是176994604 今天太晚了 有时间再聊吧 明天还有日语考试呢 哈哈
本回答被提问者采纳The method parseInt(String) in the type Integer is not applicable for the arguments (Object)
有这个错误
这个不知怎么用
那你的request保存的肯定不是整形了 自然会类型转会错误
request.setAttribute(“count”,1);
这样保存一个整数就不会错了,记住保存的要是整形
不懂 我太菜了 还是谢啦
追答我看你下面的问题代码应该没错 ,用List泛型的时候有没有在jsp页面导入ReplyBean这个类的包啊