Springmvc responsebody: How to return the object property to the front-end in the format of date, springresponsebody
1. Add dependency
<! -- Jackson Json processing toolkit -->
<Dependency>
<GroupId> org. codehaus. jackson </groupId>
<ArtifactId> jackson-mapper-asl </artifactId>
<Version >$ {jackson. version} </version>
</Dependency>
<Dependency>
<GroupId> com. fasterxml. jackson. core </groupId>
<ArtifactId> jackson-core </artifactId>
<Version >$ {jackson. core. version} </version>
</Dependency>
<Dependency>
<GroupId> com. fasterxml. jackson. core </groupId>
<ArtifactId> jackson-databind </artifactId>
<Version >$ {jackson. core. version} </version>
</Dependency>
<properties> <jackson.version>1.9.13</jackson.version> <jackson.core.version>2.4.2</jackson.core.version> </properties>
2. Add @ JsonFormat (pattern = "yyyy-MM-dd HH: mm: ss") to the getter method of the object class ")
Try again and it will work.