I had to format a date to dispaly in the jsp page. For that, i used JSTL. The JavaServer Pages Standard Tag Library (JSTL) encapsulates as simple tags the core functionality common to many Web applications. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating existing custom tags with JSTL tags.
http://java.sun.com/products/jsp/jstl/
I used JSTL Format Library —
Tag. This tag has pattern attribute.
http://download-west.oracle.com/otn_hosted_doc/jdeveloper/905/working_with_html_pages/f1_html_xsql_jsp/f1_jspfmtformatdate.html
For that patten, we can give the pattern we need.
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
eg:
fmt:formatDate timeZone="${definedTimeZone}" value="${value}" pattern="EEE MMM dd HH:mm:ss z yyyy"
No comments:
Post a Comment