首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

c:forEach 时出错解决思路

2012-01-11 
c:forEach 时出错原码是这样的:c:forEachvar item items ${results} c:iftest ${item.date20

c:forEach 时出错
原码是这样的:
<c:forEach   var= "item "   items= "${results} ">
<c:if   test= "${item.date   ==   '2007615 '} ">
<c:out   value= "${item.content} "/>
</c:if>
</c:forEach>
结果它把戏item.date   ==   '2007615 '   的   item.content   显示了   results.size   这么多遍..怎么也看不出错在哪里?


[解决办法]
<c:if test= "${item.date == '2007615 '} ">
应该是条件不对。不然的话就不会显示多遍
试一下
<c:if test= "${item.date eq '2007615 '} ">

热点排行