Datetag.tld file:
1 <?XML version= "1.0" encoding= "Iso-8859-1"?>2 <!DOCTYPE taglib3 Public "-//sun Microsystems, Inc.//dtd JSP Tag Library 1.2//en"4 "Http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">5 <taglib>6 <tlib-version>1.0</tlib-version>7 <jsp-version>1.2</jsp-version>8 <Short-name>Date</Short-name>9 <URI>Http://com.demo.util.datejstl/tags</URI>Ten <Tag> One <name>Date</name> A <Tag-class>Com.demo.util.jstl.JSTLUtil</Tag-class> - <attribute> - <name>Value</name> the <Required>True</Required> - <Rtexprvalue>True</Rtexprvalue> - </attribute> - <attribute> + <name>Parttern</name> - <Required>True</Required> + <Rtexprvalue>True</Rtexprvalue> A </attribute> at </Tag> - </taglib>
In the JSP page, refer to:
<%@ taglib uri= "http://com.demo.util.datejstl/tags" prefix= "date"%>
To use in a JSP page:
<date:date value= "${time}" parttern= "Yyyy-mm-dd HH:mm:ss" ></date:date></div>
How to format a timestamp string as a time label in a JSP page