How to display formated Calendar type in JSTL?

Posted by maectpo on Stack Overflow See other posts from Stack Overflow or by maectpo
Published on 2010-05-17T12:14:57Z Indexed on 2010/05/17 12:21 UTC
Read the original article Hit count: 217

Filed under:
|
|

Hi,

I am using Calendar type in Java and I would like to display formated date in jstl.

I was trying:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<fmt:parseDate var="date" type="date" dateStyle="short" value="${photo.dateCreated}" />
<c:out value="${data}" />

But it doesn't work:

java.text.ParseException: Unparseable date

Can JSP format "Calendar" type?

© Stack Overflow or respective owner

Related posts about java

Related posts about jstl