请大家帮看下,谢谢了!
一段代码,请大家帮我看下,问题出在红色那行
<%
String url = "news%d";
for (int i = 0; i < 9; i++) {
url =String.format(url,i);
//url=url+i;
List list = (List) request.getSession().getAttribute(url);
if (list != null) {
News news = (News) list.get(list.size() - 1);
%>
<TR>
<TD class=news colSpan=2>
<A href="read.do?id=<%=news.getId()%>"><%=news.getArticleName() + url%></A> //这段代码的输出的url是9个news0,也就是传的i全是0,不知道为什么
</TD>
</TR>
<%
} else {
continue;
}
}
%>
------解决方案--------------------