jdk-1.7.0_51
プラットフォームでtomcat-7.0.42
のwindows 7
私の JSP ページの使用:
<fmt:formatDate value='${abtest.modifiedDate}' pattern="yyyy-MM-dd HH:mm:ss"/>
ここで、abtest.modifiedDate
属性はタイプjava.util.Date
であり、インスタンスで初期化されjava.sql.Timestamp
ます。
次の例外をスローします。
javax.servlet.jsp.JspException: javax.el.ELException: Cannot convert 1/24/14 4:31 PM of type class java.sql.Timestamp to class org.joda.time.DateTime
abtest.modifiedDate
属性が初期化されorg.joda.time.DateTime
ておらず、すべての環境で発生するわけではないため、エラーは奇妙に思えます。
また、タグで: を置き換えようとしましたが、別のエラーが発生しまし<fmt:formatDate...
た:<joda:format ...
javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: value attribute of format tag must be a ReadableInstant or ReadablePartial, was: java.sql.Timestamp