项目中用freemarker 做显示层,可能会遇到取出数据前几条,通过用freemarker 取数据用

项目中应用:

点击(此处)折叠或打开

  1. [#assign n = 0]
  2. [#list cocoPersonInfo.cocoPersonResues as v]
  3. [#assign n = n + 1]
  4.     <tr >
  5.       <td width="66" colspan="2" >${v.worktime_begin}</td>
  6.       <td width="66" colspan="2" >${v.worktime_end}</td>
  7.       <td width="300" colspan="10" >${v.workplace}</td>
  8.       <td width="168" colspan="4" >${v.occupation}</td>
  9.     </tr>
  10. [#if n > 4]
  11. [#break]
  12. [/#if]
  13. [/#list]
  14. [#if n < 5]
  15. [#list n..4 as i]
  16.     <tr >
  17.       <td width="66" colspan="2" ></td>
  18.       <td width="66" colspan="2" ></td>
  19.       <td width="300" colspan="10" ></td>
  20.       <td width="168" colspan="4" ></td>
  21.     </tr>
  22. [/#list]
  23. [/#if]
装载自:http://blog.csdn.net/chenwei160803/article/details/6996472
12-24 12:04