weixin_42356238
weixin_42356238
2010-01-21 09:57
浏览 842
已采纳

freemarker嵌套循环怎么写

         下面是JSP页面代码





${product.hmprice }元


/c:forEach
/c:forEach
这是我根据以上写的ftl(freemarker 标签写的)
<#if typeProList?exists>
<#list typeProList[0..0] as each>
<#list each.proList[0..1] as product>


${product.hmprice }元


</#list>
</#list>
</#if>

但是报错:list each.proList[0..1] as product [on line 24, column 37 in probottom.ftl]

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • liuchunping454135329
    liuchunping454135329 2010-01-25 18:07
    已采纳

    <#list each.proList[0..1] as product>
    判断null啊

    点赞 评论
  • CaiHuajiang
    CaiHuajiang 2010-01-21 10:56

    <#list each.proList[0..1] as product>
    改为
    <#list (each.proList)[0..1] as product>
    试试

    点赞 评论

相关推荐