Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSTL Date comparison

I've seen some posts about date comparisons in JSTL, but I still can't get it to work.

I have a date field, which I want to test whether is after 01-01-1970.

<c:if test="${user.BirthDate > whatGoesHere}">
    <doSomeLogic/>
</c:if>

Maybe a bean should be used?

Thanks !

like image 743
Nati Avatar asked Sep 13 '12 08:09

Nati


1 Answers

U can use jstl and usebean something like this

    <jsp:useBean id="now" class="java.util.Date"/>
    <c:if test="${someEvent.startDate lt now}"> 
    It's history!</c:if>
like image 172
Saurabh Ande Avatar answered Sep 27 '22 23:09

Saurabh Ande