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

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>
 
原文地址:https://www.cnblogs.com/yufenghou/p/3393856.html