码迷,mamicode.com
首页 > Web开发 > 详细

jstl循环list加逗号

时间:2015-04-10 19:25:00      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

 <c:forEach var="c" items="${v.categories}">


                    <c:if test="${flag}">,</c:if>
                    ${c.name}

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


                </c:forEach>

 

<c:choose>
                <c:when test="${fn:length(productEntities) > 0}">
                    <c:forEach var="p" items="${productEntities}" varStatus="idx">
                        <c:if test="${idx.index == 0}">
                            ${p.productName}
                        </c:if>
                        <c:if test="${idx.index != 0}">
                            ,${p.productName}
                        </c:if>
                    </c:forEach>
                </c:when>
                <c:otherwise>
                     为空
                </c:otherwise>
            </c:choose>

jstl循环list加逗号

标签:

原文地址:http://www.cnblogs.com/yaoyao66123/p/4415118.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!