el 在页面指定日期与当前日期比较

<jsp:useBean id="now" class="java.util.Date" />   
<fmt:formatDate value="${now}" type="both" dateStyle="long" pattern="yyyy-MM-dd" var="nowDate"/> 
<fmt:formatDate value="${request.TRAIN_TIME}" type="both" dateStyle="long" pattern="yyyy-MM-dd" var="trainDate"/> 
<c:if test="${nowDate gt trainDate}" var="rs">
已截止
</c:if>
<c:if test="${!rs}">
报 名
</c:if>

 用于时间比较。不需要通过js。

你可能感兴趣的:(EL)