1.用於根據不同的值顯示對應的內容,不能選擇
<select name="grade"> <c:choose> <c:when test="${grade == 'A'}"> <option value="A" selected>A</option> </c:when> <c:when test="${grade == 'B'}"> <option value="B" selected>B</option> </c:when> <c:when test="${grade == 'C'}"> <option value="C" selected>C</option> </c:when> </c:choose> </select>
2.用於根據值設置select的默認選項,可以選擇
<select name="grade"> <option value="A" <c:if test="${grade=='A'}">selected</c:if>>A</option> <option value="B" <c:if test="${grade=='B'}">selected</c:if>>B</option> <option value="C" <c:if test="${grade=='C'}">selected</c:if>>C</option> </select>
JSTL轉義:<c:out value="${notifyTemplate.content}" ></c:out>