日期:2014-05-18  浏览次数:20726 次

jstl when otherwise 多重判断问题
问一下,JSTL标签里的多重判断问题
下面的语句可不可以?   即能不能嵌套判断?

<c:choose>
          <c:when   test= " "> </c:when>
 
          <c:otherwise>
                        <c:when   test= " "> </c:when>         <!--这里能不能加入这个判断?-->
                     
                        <c:otherwise> </c:otherwise>
          </c:otherwise>
    <c:choose>


------解决方案--------------------
应该是这样:lz的 <c:choose> 掉了两个 "/ "

<c:choose>
<c:when test= " "> </c:when>
<c:otherwise>
<c:choose>
<c:when test= " "> </c:when>
<c:otherwise> </c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
------解决方案--------------------
<c:if> 也可以。

<c:if test= "${param.aaa== 'ok '} ">
okaaa
<c:if test= "${param.bbb== 'ok '} ">
okbbb
<c:if test= "${param.ccc== 'ok '} ">
okccc
</c:if>
</c:if>
</c:if>