In one of my previous blogs:
wrote about how to convert the background date type to the foreground display, today I'm using the fourth method
<value= "&{diary.releasedate}" type= "date" pattern = "Yyyy-mm-dd"/>
Appears: Unable to convert string "&{diary.releasedate}" to class ' java.util.Date ' for attribute ' value ': Property Editor N OT registered with the Propertyeditormanager exception
The reason is that although releasedate is set to the date type in entity diary, &{diary.releasedate} is taken out as a string type and cannot be converted to a date type
The output will be normal as follows
<value= "<%=new Date ()%>" pattern= "YYYY-MM-DD"/ >
The workaround is to first parse the string to date and then format the date
<value= "${entity.ctime}" var= "date" pattern= " Yyyymmddhhmm "/><value=" ${date} " pattern = "Yyyy-mm-dd hh:mm"/>
JSTL label Fmt:formatdate formatted date String to date