很奇怪的问题!我的开发环境和运行环境都是jdk1.5访问JSP时报错:The type List is not generic; it cannot be parameterized with arguments <PubTopicItemDO>JSP语句是:
List<PubTopicItemDO> topicItems = topicDO.getContentDO().getItems();
for (Iterator<PubTopicItemDO> it = topicItems.iterator(); it.hasNext();) {
PubTopicItemDO itemDO = (PubTopicItemDO) it.next();
....
}其中topicDO.getContentDO().getItems()定义如下:
public List<PubTopicItemDO> getItems() {
return new ArrayList<PubTopicItemDO>(itemList);
}这样怎么会提示泛型问题呢?后台程序运行一切正常,就是jsp编译出错!
List<PubTopicItemDO> topicItems = topicDO.getContentDO().getItems();
for (Iterator<PubTopicItemDO> it = topicItems.iterator(); it.hasNext();) {
PubTopicItemDO itemDO = (PubTopicItemDO) it.next();
....
}其中topicDO.getContentDO().getItems()定义如下:
public List<PubTopicItemDO> getItems() {
return new ArrayList<PubTopicItemDO>(itemList);
}这样怎么会提示泛型问题呢?后台程序运行一切正常,就是jsp编译出错!
解决方案 »
- java的类加载器有哪些,它们的顺序是什么?
- TCP服务器与客户端交互
- Call to 'super' must be the first statement in the constructor body..这句话是什么意思....
- 如何用JAVA实现从网络上获取一张图片,并输出?
- 嵌入网页的applet,超奇怪的现象!高手指点
- DefaultRenderingErrorListener.errorOccurred:
- 请教一个算法问题!
- 求救,报表设计的一些入门知识问题,高分相送
- Jb7中如何实现本地Jdatastore数据库连接功能?
- 如何在applet下连接oracle数据库?
- 求一字符串x(标题过短的设定怎么这么郁闷)
- java对象中的主类型元素存在哪里,是否和main函数中的主类型变量一样存在堆栈中,还是作为对象的一部分存在堆中?
你修改成java.util.List即可
http://blog.csdn.net/thinkGhoster/archive/2007/11/09/1876667.aspx