jsp页面导入:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
使用语法:
<c:choose>
<c:when test="${c.id == '1'}"><!-- if (id==1) -->
<!-- 执行code -->
</c:when>
<c:when test="${c.id == '2'}"><!-- if (id==2) -->
<!-- 执行code -->
</c:when>
<c:otherwise> <!-- else(id==其他) -->
<!-- 执行code -->
</c:otherwise>
</c:choose>
注意点:标签里面上不能有任何注释的。
<c:choose>
<c:when test="${a=='1'}">
</c:when>
<c:when test="${a=='2'}">
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>