高手请进,这里有个简单的问题,但我完全没头绪
for(Iterator(Article) it = articles.iterator();it.hasNext();){
Article a = it.next();
%>
<tr class="jive-even">
<td class="jive-first" nowrap="nowrap" width="1%"><div class="jive-bullet"> <img src="images/read-16x16.gif" alt="已读" border="0" height="16" width="16">
<!-- div-->
</div></td>
<td nowrap="nowrap" width="1%">
</td>
<td class="jive-thread-name" width="95%"><a id="jive-thread-1" href="http://bbs.chinajavaworld.com/thread.jspa?threadID=744236&tstart=25">初学java遇一难题!!望大家能帮忙一下 谢谢了</a></td>
<td class="jive-author" nowrap="nowrap" width="1%"><span class=""> <a href="http://bbs.chinajavaworld.com/profile.jspa?userID=226030">fei870407</a> </span></td>
<td class="jive-view-count" width="1%"> 104</td>
<td class="jive-msg-count" width="1%"> 5</td>
<td class="jive-last" nowrap="nowrap" width="1%"><div class="jive-last-post"> 2007-9-13 上午9:31 <br>
by: <a href="http://bbs.chinajavaworld.com/thread.jspa?messageID=780182#780182" title="jingjiangjun" style="">jingjiangjun »</a> </div></td>
</tr>
<tr class="jive-odd">
<td class="jive-first" nowrap="nowrap" width="1%"><div class="jive-bullet"> <img src="images/read-16x16.gif" alt="已读" border="0" height="16" width="16">
<!-- div-->
</div></td>
<td nowrap="nowrap" width="1%">
</td>
<td class="jive-thread-name" width="95%"><a id="jive-thread-2" href="http://bbs.chinajavaworld.com/thread.jspa?threadID=744234&tstart=25">请 兄弟们指点下那里 错误,,,</a></td>
<td class="jive-author" nowrap="nowrap" width="1%"><span class=""> <a href="http://bbs.chinajavaworld.com/profile.jspa?userID=226028">403783154</a> </span></td>
<td class="jive-view-count" width="1%"> 52</td>
<td class="jive-msg-count" width="1%"> 2</td>
<td class="jive-last" nowrap="nowrap" width="1%"><div class="jive-last-post"> 2007-9-13 上午8:40 <br>
by: <a href="http://bbs.chinajavaworld.com/thread.jspa?messageID=780172#780172" title="downing114" style="">downing114 »</a> </div></td>
</tr>
<%
}
红色字是错误的部分,错误提示:Syntax error on token "it", delete this token
请问这个是什么错误。。。
[解决办法]
你用了泛型?泛型应该是 <> 而不是 ()
for(Iterator(Article) it = articles.iterator();it.hasNext();){
修改为:
for(Iterator<Article> it = articles.iterator();it.hasNext();){