<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:formatDate value="${d.belongTime}" pattern="yyyy-MM-dd"/>
报一下异常:
javax.el.ELException: Cannot convert 2015-05-09 00:00:00 of type class java.lang.String to class java.util.Date
解决方式:
<fmt:parseDate value="${d.belongTime}" var="date" pattern="yyyy-MM-dd"/>
<fmt:formatDate value="${date}" pattern="yyyy-MM-dd"/>