使用fmt:formatDate JSP格式化日期 [英] Format Date with fmt:formatDate JSP

查看:252
本文介绍了使用fmt:formatDate JSP格式化日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下格式格式化日期:

I am trying to format a date with:

<fmt:formatDate value="${newsletter.createdOn}" pattern="MM/dd/yyyy"/>

新闻通讯是具有createdOn属性为java.util.Date的对象.

newsletter is an object with a createdOn property which is java.util.Date.

当我调用前面的句子时,我得到:

When I invoke the previous sentence I get:

根据TLD,属性值不接受表达式.

According to the TLD, the attribute value does not accept expressions.

我正在使用

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

有人知道我该如何解决这个问题?

Does anyone know how can I work around this problem?

我正在使用Tomcat附带的jstl.jar.

I am using the jstl.jar coming with tomcat.

在jstl.jar/META-INF/MANIFEST.MF下:

Under jstl.jar/META-INF/MANIFEST.MF stays:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3 
Created-By: 1.4.2-b28 (Sun Microsystems Inc.)
Specification-Title: JavaServer Pages Standard Tag Library (JSTL)
Specification-Version: 1.1
Implementation-Title: JavaServer Pages Standard Tag Library API Refere
 nce Implementation
Implementation-Version: 1.1.0-D13
Implementation-Vendor: Sun Microsystems, Inc.
Implementation-Vendor-Id: com.sun
Extension-Name: javax.servlet.jsp.jstl

我正在使用Apache Tomcat 6.0.14版

I am using Apache Tomcat Version 6.0.14

推荐答案

尝试

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

这篇关于使用fmt:formatDate JSP格式化日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆