Custom JSP taglib lets you calculate various attributes for the current date. Tag creates in the page scope a set of predefined
variables for all the attributes of the current date. For example:
<%@ taglib uri="taglib.tld" prefix="t" %> <t:today/> <p>Date: <%=currentDate%> <br>Year: <%=currentYear%> <br>Month: <%=currentMonth%> <br>Day: <%=currentDay%> <br>Day of week: <%=currentDayOfWeek%> <br>Hour: <%=currentHour%> <br>Minute: <%=currentMinute%> If you are using JSTL you can use some like this ${currentDate} for example. Predefined names and types are:
Tags are: today Tag calculates all the attributes for the current date. Parameters are: none ifWeekEnd Body tag executes own body if today is Sunday or Saturday. Parameters are: none ifNotWeekEnd Body tag executes own body if today is not Sunday or Saturday. Parameters are: none for downloading: Library: todaytag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|