- 方式一(建议使用)
<select id="stuIsOwn" name="stuIsOwn" disabled>
<option value="0" <c:if test="${studentInfo.stuIsOwn eq '0' }"> selected </c:if> >是</option>
<option value="1" <c:if test="${studentInfo.stuIsOwn eq '1' }"> selected </c:if> >否</option>
</select>
<label for="">性别:</label>
男:<input type="radio" name="stuSex" value="男"
<c:if test="${studentInfo.stuSex eq '男' }"> checked </c:if> style="width: 20px; margin-top: 12px;">
女:<input type="radio" name="stuSex" value="女" <c:if test="${studentInfo.stuSex eq '女' }"> checked </c:if> style="width: 20px;">
注:引入标签:<%@ taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core”%>
2. 方式二
<s:select list="#{0:'--请选择--',1:'处理中',2:'已完成'}" listKey="key" listValue="value" name="curStatus" value="%{curStatus}"></s:select>
- 方式三
<select name="curStatus" >
<option value="0">-请选择-</option>
<option value="1" <s:if test="%{curStatus==1}">selected</s:if> >处理中</option>
<option value="2" <s:if test="%{curStatus==2}">selected</s:if> >已处理</option>
</select>