您的位置:首页 > Web前端 > JavaScript

JSTL 的 if else : 有 c:if 没有 else 的处理

2013-10-29 10:35 316 查看
jstl的c:if 没有else

想要实现if...else...:

可以用下面的解决

--------------------------------------------------------------------

结构:

<c:choose>

<c:when test="">    如果
</c:when>

<c:otherwise>  否则
</c:otherwise>

</c:choose>

代码:

<c:choose>
<c:when test="${sessionScope.USERTYPE == 'inner'}">
<c:set value="${context_root}/igmgr/MEB004.dow" var="action" scope="page"/>
</c:when>
<c:when test="${sessionScope.USERTYPE == 'merc'}">
<c:set value="${context_root}/igmgr/MEB021.dow" var="action" scope="page"/>
</c:when>
<c:otherwise>
<c:set value="${context_root}/igmgr/MEB020.dow" var="action" scope="page"/>
</c:otherwise>
</c:choose>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: