Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
y 的值为 null,但它总是执行其他部分。部分。null 被认为不为空。
<c:choose> <c:when test="${empty y}"> value="" </c:when> <c:otherwise> value="${y}" </c:otherwise>
如果y是字符串,像这样写你的代码
y
<c:choose> <c:when test="${y==null || y==''}"> value="" </c:when> <c:otherwise> value="${y}" </c:otherwise> </c:choose>