在页面上利用 标签 输出年月
<!-- -->
<select name="year">
<!-- 循环输出年代 -->
<c:set var="curYear" value="<%= Calendar.getInstance().get(Calendar.YEAR) %>"></c:set>
<c:forEach begin="0" end="10" var="step">
<option value="${curYear - step}"
<c:if test="${ (curYear - step) == year}">selected="selected"</c:if>
>${curYear - step}</option>
</c:forEach>
<c:remove var="curYear"/>
</select>
年
<label>
<select name="month">
<c:forEach begin="1" end="12" var="step">
<option value="${step}"
<c:if test="${step == month}">selected="selected"</c:if>
>${step}</option>
</c:forEach>
</select>
月
</label>