首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

jstl when otherwise 多重判断有关问题

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

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>

热点排行