tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Anderson" <stuts_anderson...@hotmail.com>
Subject RE: how to use methods with parameters
Date Thu, 05 Feb 2004 18:23:19 GMT
Here's a little tester jsp that demonstrates one way to do it:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<jsp:useBean id="endDate" class="java.util.Date">
<jsp:useBean id="startDate" class="java.util.Date"/>
    <%-- this sets the startDate to one year ago --%>
    <c:set target="${startDate}" property="year" value="103"/>
</jsp:useBean>
startDate: <c:out value="${startDate}"/><br/>
endDate: <c:out value="${endDate}"/><br/>

<%-- of course it would probably be better to actually perform this 
multiplication
     and insert it into the code --%>
calcDate:<c:out value="${(startDate.time - endDate.time) / (24 * 60 * 60 * 
1000)}"/>

-Ben


>From: "Just Fun 4 You" <justfun4you@nexgo.de>
>Reply-To: "Tag Libraries Users List" <taglibs-user@jakarta.apache.org>
>To: <taglibs-user@jakarta.apache.org>
>Subject: how to use methods with parameters
>Date: Thu, 5 Feb 2004 17:38:14 +0100
>
>Hi,
>
>is it possible to use JSTL for an expression like
>
><%=calculateDays(startDate, endDate) %> ???
>
>
>probably not, but I am too new to JSTL to figure it out by myself. Could
>someone advise me?
>
>thanks.
>Dirk
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>

_________________________________________________________________
What are the 5 hot job markets for 2004? Click here to find out. 
http://msn.careerbuilder.com/Custom/MSN/CareerAdvice/WPI_WhereWillWeFindJobsIn2004.htm?siteid=CBMSN3006&sc_extcmp=JS_wi08_dec03_hotmail1


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