页面中可能说出现在forEach循环中间需要出力分隔符的问题,

比如:

小明 1年级,小王 2年级, 小张 3年级(循环单位是 ${bean.name} ${bean.class})

此时的逗号出力,我采用下面方法实现完成。

 

<c:forEach var="bean" items="students">

  <c:if test="printCommaFlag">,</c:if>

  ${bean.name}&nbsp;${bean.class}

    <c:set var="printCommaFlag" value="true" scope="request"/>

</c:forEach>

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案