Illegal use of <when>-style tag without <choose> as its direct paren


在jsp页面使用c:when标签时,报错
Illegal use of <when>-style tag without <choose> as its direct parent
原因是:必须在c:when标签必须在c:choose里面使用。
具体用法如下:

<c:choose>
    <c:when test="${book.compareToday=='0'}">
        <div id="test">通过</div>
    </c:when>  
    <c:otherwise>
不通过
</c:otherwise>
</c:choose>

你可能感兴趣的:(jsp,jstl)