`
wotf23771
  • 浏览: 34035 次
  • 性别: Icon_minigender_1
  • 来自: 邯郸
社区版块
存档分类
最新评论

freemarker 判断list记录大于0

阅读更多

freemarker 判断list记录大于0 用<#if (list?size > 0)></#if>即可。下面是个显示附件的实例

<#if (post.attachments?size > 0)>
      <table width="100%" height="20px" cellpadding="0" cellspacing="0" class="post_bodyTable">
       <tbody>
        <tr>
         <td class="post_body_text" valign="bottom">
          相关附件:
          <#list post.attachments as attach>
           链接:<a href="${attach.physicalFilename}">${attach.realFilename}</a>&nbsp;
           大小:${attach.filesize}&nbsp;描述:${attach.description}&nbsp;上传日期:${attach.uploadDate}
           <br />
          </#list>
         </td>
        </tr>
       </tbody>
      </table>
      </#if>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics