当前位置:网站首页>JSON data transfer parameters
JSON data transfer parameters
2022-07-02 23:30:00 【pengege666】
List of articles
Use JSON Getting started with data transfer
step1:pom.xml Import coordinates from
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.0</version>
</dependency>
step2: Add core configuration file @EnableWebMvc annotation

SpringMVCConfig.java
@Configuration
@ComponentScan("com.itheima.controller")
@EnableWebMvc
public class SpringMVCConfig {
}
step3: structure json Format data

step4: Add... Before the parameter @RequestBody annotation

UserController.java
@Controller
@RequestMapping("/User")
public class UserController {
//2.2 Set the access path of the current operation
@RequestMapping("/save")
@ResponseBody
public String save(@RequestBody List<String> list){
System.out.println(list);
System.out.println("user save ...");
return "{'module':'springmvc'}";
}
}

Parameter type
Collection types


POJO Parameters


Set parameters


Reference resources :
thank SpringMVC note
边栏推荐
- 基于FPGA的VGA协议实现
- Why can't the start method be called repeatedly? But the run method can?
- 面试过了,起薪16k
- C#中Linq用法汇集
- All things work together, and I will review oceanbase's practice in government and enterprise industry
- RuntimeError: no valid convolution algorithms available in CuDNN
- Win11启用粘滞键关闭不了怎么办?粘滞键取消了但不管用怎么解决
- Solving ordinary differential equations with MATLAB
- Call vs2015 with MATLAB to compile vs Project
- Eight honors and eight disgraces of the programmer version~
猜你喜欢

Cryptography -- the mode of block cipher

Go basic data type

Three solutions to frequent sticking and no response of explorer in win11 system

程序员版本的八荣八耻~

【STL源码剖析】仿函数(待补充)

YOLOX加强特征提取网络Panet分析

Writing of head and bottom components of non routing components

(毒刺)利用Pystinger Socks4上线不出网主机

2022 latest and complete interview questions for software testing

理想汽车×OceanBase:当造车新势力遇上数据库新势力
随机推荐
海思 VI接入视频流程
Jinglianwen technology's low price strategy helps AI enterprises reduce model training costs
Compose 中的 'ViewPager' 详解 | 开发者说·DTalk
Interface switching based on pyqt5 toolbar button -1
Li Kou brush questions (2022-6-28)
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚
SQL进阶语法
Go project operation method
一文掌握基于深度学习的人脸表情识别开发(基于PaddlePaddle)
[live broadcast appointment] database obcp certification comprehensive upgrade open class
【直播预约】数据库OBCP认证全面升级公开课
Explain promise usage in detail
Go basic data type
MarkDown基本语法
高数有多难?AI 卷到数学圈,高数考试正确率 81%!
密码技术---密钥和SSL/TLS
MySQL基础
Implementation of VGA protocol based on FPGA
Numerical solution of partial differential equations with MATLAB