是用struts2标签写的<s:property value="Fetchtime"/>
Fetchtime是Date类型,数据库显示的是2012-4-12,在页面却显示12-4-12 0:00:00.000
如何改成数据库显示的那种的,用下面的方法
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<fmt:formatDate value="Fetchtime" pattern="yyyy年MM月dd日" type="date" dateStyle="full"/>会显示Unable to convert string "Fetchtime" to class "java.util.Date" for attribute "value": Property Editor not registered with the PropertyEditorManager
Fetchtime是Date类型,数据库显示的是2012-4-12,在页面却显示12-4-12 0:00:00.000
如何改成数据库显示的那种的,用下面的方法
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<fmt:formatDate value="Fetchtime" pattern="yyyy年MM月dd日" type="date" dateStyle="full"/>会显示Unable to convert string "Fetchtime" to class "java.util.Date" for attribute "value": Property Editor not registered with the PropertyEditorManager
<s:date name="#time.landTime" format="yyyy-MM-dd HH:mm:ss" />
虽然没用过格式化的标签,感觉这句有问题吧value="Fetchtime" 用el表达式取下值试试