当前位置:网站首页>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
边栏推荐
- 密码技术---分组密码的模式
- Why can't the start method be called repeatedly? But the run method can?
- 阿里云有奖体验:如何使用 PolarDB-X
- C MVC creates a view to get rid of the influence of layout
- 密码技术---密钥和SSL/TLS
- 可知论与熟能生巧
- Potplayer set minimized shortcut keys
- [error record] the flutter reports an error (could not resolve io.flutter:flutter_embedding_debug:1.0.0.)
- vim区间删行注释
- RuntimeError: no valid convolution algorithms available in CuDNN
猜你喜欢
What if win11 can't turn off the sticky key? The sticky key is cancelled but it doesn't work. How to solve it
Catalogue of digital image processing experiments
密码技术---分组密码的模式
Getting started with golang: for Range an alternative method of modifying the values of elements in slices
Redis expiration policy +conf record
Alibaba cloud award winning experience: how to use polardb-x
为什么RTOS系统要使用MPU?
Golang common settings - modify background
Where is the win11 microphone test? Win11 method of testing microphone
Where is the win11 automatic shutdown setting? Two methods of setting automatic shutdown in win11
随机推荐
[error record] the flutter reports an error (could not resolve io.flutter:flutter_embedding_debug:1.0.0.)
4 special cases! Schools in area a adopt the re examination score line in area B!
Cryptography -- the mode of block cipher
How difficult is it to be high? AI rolls into the mathematics circle, and the accuracy rate of advanced mathematics examination is 81%!
@How to use bindsinstance in dagger2
实现BottomNavigationView和Navigation联动
How can cross-border e-commerce achieve low-cost and steady growth by laying a good data base
购买完域名之后能干什么事儿?
Connexion à distance de la tarte aux framboises en mode visionneur VNC
海思 VI接入视频流程
Boost库链接错误解决方案
详解Promise使用
富滇银行完成数字化升级|OceanBase数据库助力布局分布式架构中台
SharedPreferences save list < bean > to local and solve com google. gson. internal. Linkedtreemap cannot be cast to exception
Yolox enhanced feature extraction network panet analysis
golang入门:for...range修改切片中元素的值的另类方法
C#中Linq用法汇集
Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
C MVC creates a view to get rid of the influence of layout
Catalogue of digital image processing experiments