接收json数据

1.导入坐标:

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>2.9.0</version>
</dependency>

2.开启自动转换json的数据支持

package com.itheima.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@Configuration
@ComponentScan("com.itheima.controller")
@EnableWebMvc
public class springMvcConfig {
}

 

posted @ 2023-02-26 15:24  会秃头的小白  阅读(11)  评论(0编辑  收藏  举报