当我喜欢这个时
<c:choose>
<c:when test="${book.display}">
<eb:glyphicon-status icon="eye-open" value="${book.id}" />
</c:when>
<c:otherwise>
<eb:glyphicon-status icon="eye-close" value="${book.id}" />
</c:otherwise>
</c:choose>
工作正常。
但是当我创建标记showeye
<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="eb"%>
<%@ attribute name="isDisplay" required="true" rtexprvalue="true" type="java.lang.Boolean" %>
<%@ attribute name="bookId" required="true" rtexprvalue="true" type="java.lang.Long" %>
<c:choose>
<c:when test="${isDisplay}">
<eb:glyphicon-status icon="eye-open" value="${bookId}" />
</c:when>
<c:otherwise>
<eb:glyphicon-status icon="eye-close" value="${bookId}" />
</c:otherwise>
</c:choose>
当我把它放在页面上时
<eb:showeye isDisplay="${book.display}" bookId="${book.id}" />
条件不正常。我总是得到错误的结果。 有什么问题?