当前位置:网站首页>JSON数据传递参数
JSON数据传递参数
2022-07-02 22:16:00 【pengege666】
文章目录
使用JSON数据传递入门
step1:pom.xml中导入坐标
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.0</version>
</dependency>
step2:核心配置文件添加@EnableWebMvc注解

SpringMVCConfig.java
@Configuration
@ComponentScan("com.itheima.controller")
@EnableWebMvc
public class SpringMVCConfig {
}
step3:构造json格式数据

step4:参数前添加@RequestBody注解

UserController.java
@Controller
@RequestMapping("/User")
public class UserController {
//2.2设置当前操作的访问路径
@RequestMapping("/save")
@ResponseBody
public String save(@RequestBody List<String> list){
System.out.println(list);
System.out.println("user save ...");
return "{'module':'springmvc'}";
}
}

参数类型
集合类型


POJO参数


集合参数


参考:
感谢SpringMVC笔记
边栏推荐
- [adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)
- C#中Linq用法汇集
- Yolox enhanced feature extraction network panet analysis
- Getting started with golang: for Range an alternative method of modifying the values of elements in slices
- 为什么RTOS系统要使用MPU?
- All things work together, and I will review oceanbase's practice in government and enterprise industry
- 提交代码流程
- Potplayer set minimized shortcut keys
- Talk about memory model and memory order
- 跨境电商如何通过打好数据底座,实现低成本稳步增长
猜你喜欢
![[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)](/img/a3/d8421ea1539eba08bf7a5a629d92e6.jpg)
[adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)

The concepts of terminal voltage, phase voltage and line voltage in FOC vector control and BLDC control are still unclear

ADC of stm32

設置單擊右鍵可以選擇用VS Code打開文件

Catalogue of digital image processing experiments

Tiktok actual combat ~ number of likes pop-up box

C#中Linq用法汇集
![[redis notes] compressed list (ziplist)](/img/83/ff38fabb1baebc5fa4d3d72da315dc.png)
[redis notes] compressed list (ziplist)

理想汽车×OceanBase:当造车新势力遇上数据库新势力

Go basic anonymous variable
随机推荐
Brief introduction of emotional dialogue recognition and generation
采用VNC Viewer方式遠程連接樹莓派
Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
How difficult is it to be high? AI rolls into the mathematics circle, and the accuracy rate of advanced mathematics examination is 81%!
Tiktok actual combat ~ number of likes pop-up box
为什么RTOS系统要使用MPU?
Pandora IOT development board learning (HAL Library) - Experiment 3 key input experiment (learning notes)
Eight bit responder [51 single chip microcomputer]
基于Pyqt5工具栏按钮可实现界面切换-1
20220524_ Database process_ Statement retention
公司里只有一个测试是什么体验?听听他们怎么说吧
Doorplate making C language
Win11自动关机设置在哪?Win11设置自动关机的两种方法
Application of containerization technology in embedded field
Editor Caton
Solution: exceptiole 'xxxxx QRTZ_ Locks' doesn't exist and MySQL's my CNF file append lower_ case_ table_ Error message after names startup
Loss function~
RecyclerView结合ViewBinding的使用
QT qpprogressbar details
Temperature measurement and display of 51 single chip microcomputer [simulation]