当前位置:网站首页>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笔记
边栏推荐
- Go basic constant definition and use
- 2022年最新最全软件测试面试题大全
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验4 串口通讯实验(学习笔记)
- C MVC creates a view to get rid of the influence of layout
- Explain promise usage in detail
- [redis notes] compressed list (ziplist)
- Yolox enhanced feature extraction network panet analysis
- [hardware] origin of standard resistance value
- Set right click to select vs code to open the file
- FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚
猜你喜欢
Application of containerization technology in embedded field
Go basic anonymous variable
Potplayer set minimized shortcut keys
“一个优秀程序员可抵五个普通程序员!”
Yolox enhanced feature extraction network panet analysis
[Yangcheng cup 2020] easyphp
(stinger) use pystinger Socks4 to go online and not go out of the network host
How difficult is it to be high? AI rolls into the mathematics circle, and the accuracy rate of advanced mathematics examination is 81%!
面试过了,起薪16k
RuntimeError: no valid convolution algorithms available in CuDNN
随机推荐
CDN acceleration requires the domain name to be filed first
20220527_ Database process_ Statement retention
QT qpprogressbar details
How does win11 turn on visual control? Win11 method of turning on visual control
用matlab调用vs2015来编译vs工程
【STL源码剖析】仿函数(待补充)
CDN 加速,需要域名先备案
Getting started with golang: for Range an alternative method of modifying the values of elements in slices
密码技术---密钥和SSL/TLS
Solution: exceptiole 'xxxxx QRTZ_ Locks' doesn't exist and MySQL's my CNF file append lower_ case_ table_ Error message after names startup
(毒刺)利用Pystinger Socks4上线不出网主机
[npuctf2020]ezlogin XPath injection
采用VNC Viewer方式遠程連接樹莓派
C# MVC创建一个视图摆脱布局的影响
BBR 遭遇 CUBIC
Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
Brief introduction of emotional dialogue recognition and generation
Temperature measurement and display of 51 single chip microcomputer [simulation]
Solving ordinary differential equations with MATLAB
理想汽车×OceanBase:当造车新势力遇上数据库新势力