Using jdk-1.7.0_51 and tomcat-7.0.42 on windows 7 platform my JSP page at:
<fmt:formatDate value='${abtest.modifiedDate}' pattern="yyyy-MM-dd HH:mm:ss"/>
where the abtest.modifiedDate attribute is of type java.util.Date and initialized with java.sql.Timestamp instance.
throws the following exception:
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
The error seems to be strange because abtest.modifiedDate attribute is not initialized with org.joda.time.DateTime and it doesn't occur in all environments.
Have also tried to replace: <fmt:formatDate... with <joda:format ... tag but got another error:
javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: value attribute of format tag must be a ReadableInstant or ReadablePartial, was: java.sql.Timestamp
Add this annotation on your
DateTimefield in your entity classAnd in your
JSP, keep using thejoda format tag: