Depends. If you're using a JSP 2.0 container, you can create EL functions that map to public static Java methods. See section 2.6 of the JSP 2.0 Spec. JSTL 1.1 provides a basic set of EL functions, see section 15 of the JSTL 1.1 Spec.
However, if you're using JSTL 1.0 (JSP 1.2), then you're kind of stuck. The Unstandard taglib: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/intro.html provides some support for this through its <invoke> tag, but I'm not sure if the passing of arguments has been implemented yet. A somewhat tedious alternative is to create a JavaBean to proxy the method call. You'd have setter methods for each of the args and then a getter method that would delegate to the real method you want invoked: <c:set var="startDate" value="..."/> <c:set var="endDate" value="..."/> <jsp:useBean id="daysCalc" class="com.dotech.DaysCalculator"/> <c:set target="${daysCalc}" property="startDate" value="${startDate}"/> <c:set target="${daysCalc}" property="endDate" value="${endDate}"/> <c:out value="${daysCalc.days}"/> where DaysCalculator.getDays would do something like: return this.delegate.calculateDays(this.startDate, this.endDate); Hm, or there might be something fun you could do with a BeanInfo class... Quoting Just Fun 4 You <[EMAIL PROTECTED]>: > 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 -- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
