读书人

jstl when otherwise 多重判断有关问题

发布时间: 2012-03-15 11:50:38 作者: rapoo

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>

读书人网 >Java Web开发

热点推荐