很奇怪的问题!我的开发环境和运行环境都是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.util.List即可
http://blog.csdn.net/thinkGhoster/archive/2007/11/09/1876667.aspx