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" <[EMAIL PROTECTED]>
Reply-To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to