`
flashdream8
  • 浏览: 668359 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

在页面上利用 标签 输出年月

阅读更多

在页面上利用 标签 输出年月

<!--  -->
    <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>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics