我们在做jsp页面判断时会发现:
jstl的c:if是没有else滴。
想要实现if...else...效果要,我们就可以采取<c:choose/>方法
注意<c:otherwise/>不能和<c:if/>搭配使用否则
jsp页面报错:
javax.servlet.jsp.JspTagException: Illegal use of <when>-style tag without <choose> as its direct parent
jstl的c:if是没有else滴。
想要实现if...else...效果要,我们就可以采取<c:choose/>方法
- <c:choose>
- <c:when test="">
- </c:when>
- <c:otherwise>
- </c:otherwise>
- </c:choose>
注意<c:otherwise/>不能和<c:if/>搭配使用否则
jsp页面报错:
javax.servlet.jsp.JspTagException: Illegal use of <when>-style tag without <choose> as its direct parent

3282

被折叠的 条评论
为什么被折叠?



