首页 > Web开发 > 详细

jstl循环list加逗号

时间:2015-04-10 19:23:00      阅读:343      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!