tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin.C...@NielsenMedia.com>
Subject RE: using <c:if> tag to work out if one date is less than another .
Date Thu, 04 Sep 2003 14:13:00 GMT
You can access anything that follows JavaBean standards.
(get/setXXX)(isXXX)etc.

-----Original Message-----
From: Martin Smith [mailto:martin.smith@goldenhill.co.uk]
Sent: Thursday, September 04, 2003 9:34 AM
To: Tag Libraries Users List
Subject: RE: using <c:if> tag to work out if one date is less than
another.



Thank-you Kris, works like a dream.

Am I right in thinking you can access any property on any object in the
expression language as long as the method name begins with 'get'?

Martin

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: 04 September 2003 13:31
To: Tag Libraries Users List
Subject: Re: using <c:if> tag to work out if one date is less than
another.


<jsp:useBean id="now" class="java.util.Date"/>
...
<c:choose>
  <c:when test="${fixture.kickoffDate.time lt now.time}">
    ...
  </c:when>
  <c:otherwise>
    ...
  </c:otherwise>
</c:choose>
...

Quoting Martin Smith <martin.smith@goldenhill.co.uk>:

> Hi,
>
> I'm trying to use the <c:if> tag to determine if one date is before or
> after
> another.  My code is at the bottom of this email.
>
> fixture.kickoffDate returns a java.util.Date object.  Can I use .time to
> get
> me a long?
>
> I realise that I can't put the System.currentTimeMillis code in, but how
> can
> I get the
> current system time in to a scripting variable??
>
>
> <table>
> 	<tr>
> 	<c:if test="${fixture.kickoffDate.time < System.currentTimeMillis}"
>
> 		<td> Kick off is less than system time </td>
> 	</c:if>
> 	<c:if test="${fixture.kickoffDate.time > System.currentTimeMillis}"
>
> 		<td> Kick off is greater than system time </td>
> 	</c:if>
> 	</tr>
> </table>
>
> Using Tomcat 4.1.18 and JSTL 1.0

--
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org

Mime
View raw message