@RequestBody问题绑定字段名为" email" jackson-databind v-2.8.4和spring-boot-starter-parent v-1.4.2.RELEASE

时间:2016-12-29 08:16:55

标签: java json spring jackson

我正在尝试将json绑定到@RequestBody

控制器方法签名

public String update(@RequestBody MyDto myDto)

我的dto

public class MyDto {
    String staff;
    String user;
    String email;
    // constructor, getter, setter go here
}

json string

{
    "staff":"its staffname",
    "user": "its username",
    "email": "myemail"
}

问题

员工和用户字符串在服务器端填充,但email field is null

when i change the name to something other than email the problem goes away

0 个答案:

没有答案