Java 如何在Spring MVC中使jsonData不区分大小写

Java 如何在Spring MVC中使jsonData不区分大小写,java,json,spring-mvc,Java,Json,Spring Mvc,新春 我试图访问@RequestBody MYPOJO pojo中的json对象,这很好,但我的json数据需要与pojo中的变量名相同,并且区分大小写。我在网上找到的最好的东西是,但不是和我的项目同步,我使用的是SpringMVC。那么如何使用pojo使json不区分大小写呢 我接收json的方式 @RequestMapping(value = "create", method = RequestMethod.POST) public void createPost(HttpServletRe

新春

我试图访问
@RequestBody MYPOJO pojo
中的json对象,这很好,但我的json数据需要与pojo中的变量名相同,并且区分大小写。我在网上找到的最好的东西是,但不是和我的项目同步,我使用的是SpringMVC。那么如何使用pojo使json不区分大小写呢

我接收json的方式

@RequestMapping(value = "create", method = RequestMethod.POST)
public void createPost(HttpServletRequest req, HttpServletResponse resp, @Valid @RequestBody Post post,
        Errors errors) throws CustomException, IOException {
json数据

function jsonForPost(isEdit, id) {
var post = {};
if (isEdit) {
    post.id = id;
}
post.name = $("#name").val();
return JSON.stringify(post);
}
弹簧套
不带
弹簧套
以及控制器:

@RequestMapping(value = "/create", method = RequestMethod.POST)
public void createPost(HttpServletRequest req, HttpServletResponse resp, @Valid @RequestBody Pox post,
        Errors errors) {
    System.out.println(post.getName());


}
我曾与邮递员一起测试过:

名字,名字,名字,名字

所有这些都工作了。

使用
弹簧靴
不带
弹簧套
以及控制器:

@RequestMapping(value = "/create", method = RequestMethod.POST)
public void createPost(HttpServletRequest req, HttpServletResponse resp, @Valid @RequestBody Pox post,
        Errors errors) {
    System.out.println(post.getName());


}
我曾与邮递员一起测试过:

名字,名字,名字,名字


所有这些都工作正常。

使用springboot,使用
应用程序.yml
文件=>

spring:
  jackson:
    mapper:
      accept-case-insensitive-properties: true

使用
应用程序.yml
文件=>

spring:
  jackson:
    mapper:
      accept-case-insensitive-properties: true

你能给我配置文件的导入吗我怎样才能链接到配置文件?我不在spring boot中。你能给我配置文件的导入吗?我怎样才能链接到配置文件?我没有穿春装。
spring:
  jackson:
    mapper:
      accept-case-insensitive-properties: true