@RestController @RequestMapping("/testController") public class TestController { @RequestMapping(value = "test1",method = RequestMethod.POST) public void test1(Person person) { System.out.println(person.getName()); System.out.println(person.getBirthday()); }
}
--------------------------------------------------
Person类
public class Person { String name; @JSONField(format = "yyyy-MM-dd") Date birthday; public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } }
-------------------------------------------------