标签:style blog class code java color
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和select标签的组合使用,布布扣,bubuko.com
标签:style blog class code java color
原文地址:http://www.cnblogs.com/geb515/p/3717674.html