<%@ page import="java.io.File" errorPage="err.jsp" %> <%@ taglib uri="gnat" prefix="gnat" %> <%-- Use the Servlet 2.2+ temporary working directory to demo some file stuff. Makes it easier because the user doesn't have to configure anything and I don't have to worry about file system and user permissions for the demo. See section 3.7 of Servlet 2.3 spec for description of this attribute. --%> <%! File tempdir = null; %> <% tempdir = (File)application.getAttribute("javax.servlet.context.tempdir"); %> Gnat JSP Taglib

Gnat Taglib: tstamp

Sets the DSTAMP, TSTAMP and TODAY properties in the current page. The DSTAMP is in the "yyyymmdd" format, the TSTAMP is in the "hhmm" format and TODAY is "month day year".

example 1 - set tstamp

<gnat:tstamp/>

Getting tstamp values from their scripting variables

DSTAMP = <%= DSTAMP %>

TSTAMP = <%= TSTAMP %>

TODAY = <%= TODAY %>

Getting tstamp values using JSP expressions

<%= pageContext.getAttribute("TODAY") %> = <%= pageContext.getAttribute("TODAY") %>

<%= pageContext.getAttribute("DSTAMP") %> = <%= pageContext.getAttribute("DSTAMP") %>

<%= pageContext.getAttribute("TSTAMP") %> = <%= pageContext.getAttribute("TSTAMP") %>