tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject RE: using <c:if> tag to work out if one date is less than another .
Date Thu, 04 Sep 2003 14:36:01 GMT
Right. Do yourself a favor and spend a few minutes with the JavaBeans spec:

http://java.sun.com/products/javabeans/docs/spec.html

Specifically, pay attention to sections 8.3 "Design Patterns for Properties" and
8.8 "Capitalization of inferred names".

Quoting "Chen, Gin" <Gin.Chen@NielsenMedia.com>:

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

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

Mime
View raw message