代码如下
<c:choose> <c:when test="${ empty book }"> <input type="hidden" name="method" value="add" /> </c:when> <c:otherwise> <input type="hidden" name="method" value="update" /> <input type="hidden" name="id" value="${ book.id }" /> </c:otherwise> </c:choose>
问题:
无论book是否为null,总是获取method=add参数,获取不了update参数