logic:iterator的使用,一般用于页面呈现列表,值类型为collection(List ,ArrayList,HashMap等等)。

1. 遍历某collection的值,如逐一输出新闻的标题:

  < logic:iterate  id="news" name="newsList">
        < bean:write name="new" property="title"/>< br>
      < /logic:iterate>

2. logic:iterator标签的嵌套使用               

  < logic:iterate id="type" indexId="index" name="typeList">
         < bean:write name="type" property="typename"/>< br>
             < logic:iterate id="news" name="type" property="newsList">
                < bean:write name="news"  property="newsname"/>< br>
              < /logic:iterate>
     < /logic:iterate>

posted on 2013-02-28 15:58  路边的野花使劲踩  阅读(182)  评论(0)    收藏  举报