下拉列表回选

<select name="queryInfo.cityCode">
<!--
服务器端代码如:
public class QueryInfo {
private String cityCode;

//cityCode的getter、setter
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
}
private QueryInfo queryInfo;

//queryInfo的getter、setter
public QueryInfo getQueryInfo() {
return queryInfo;
}
public void setQueryInfo(QueryInfo queryInfo) {
this.queryInfo = queryInfo;
}
-->
<option value="0000" <c:if test="${queryInfo.cityCode=='0000' }">selected="selected"</c:if>>请选择地市</option>
<option value="5910" <c:if test="${queryInfo.cityCode=='5910' }">selected="selected"</c:if>>福州</option>
<option value="5920" <c:if test="${queryInfo.cityCode=='5920' }">selected="selected"</c:if>>厦门</option>
<option value="5930" <c:if test="${queryInfo.cityCode=='5930' }">selected="selected"</c:if>>宁德</option>
<option value="5940" <c:if test="${queryInfo.cityCode=='5940' }">selected="selected"</c:if>>莆田</option>
<option value="5950" <c:if test="${queryInfo.cityCode=='5950' }">selected="selected"</c:if>>泉州</option>
<option value="5960" <c:if test="${queryInfo.cityCode=='5960' }">selected="selected"</c:if>>漳州</option>
<option value="5970" <c:if test="${queryInfo.cityCode=='5970' }">selected="selected"</c:if>>龙岩</option>
<option value="5980" <c:if test="${queryInfo.cityCode=='5980' }">selected="selected"</c:if>>三明</option>
<option value="5990" <c:if test="${queryInfo.cityCode=='5990' }">selected="selected"</c:if>>南平</option>
</select>

你可能感兴趣的:(下拉列表回选)