当前位置:网站首页>Request and response
Request and response
2022-07-02 23:30:00 【pengege666】
List of articles
Request mapping path
Team multiplayer development , Each person sets a different request path , How to solve the conflict — Set the module name as the request path prefix 

Use postman The software sends a request 
Request parameters
General parameter
Send with parameters Get request

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


When requesting parameter name and formal parameter variable name Different when , Use RequestParam Solve .
Send with parameters Post request
Be careful Post How the request is sent 

POJO Parameters


public class User {
String name;
int id;
// Omit Getter,Setter and ToString Method
}
UserController.java
@Controller
@RequestMapping("/User")
public class UserController {
//2.2 Set the access path of the current operation
@RequestMapping("/save")
@ResponseBody
public String save(User user){
System.out.println(user);
System.out.println("user save ...");
return "{'module':'springmvc'}";
}
}


POJO Nested POJO Parameters



Array parameters

Set parameters

边栏推荐
- 购买完域名之后能干什么事儿?
- Call vs2015 with MATLAB to compile vs Project
- 解决:exceptiole ‘xxxxx.QRTZ_LOCKS‘ doesn‘t exist以及mysql的my.cnf文件追加lower_case_table_names后启动报错
- Fusion de la conversion et de la normalisation des lots
- Warning: implicitly declaring library function 'printf' with type 'int (const char *,...)‘
- I've been interviewed. The starting salary is 16K
- [live broadcast appointment] database obcp certification comprehensive upgrade open class
- 第三方支付功能测试点【杭州多测师_王sir】【杭州多测师】
- Win11自动关机设置在哪?Win11设置自动关机的两种方法
- 基于Pyqt5工具栏按钮可实现界面切换-2
猜你喜欢

RuntimeError: no valid convolution algorithms available in CuDNN

Go basic anonymous variable

Yolox enhanced feature extraction network panet analysis

为什么RTOS系统要使用MPU?
![Temperature measurement and display of 51 single chip microcomputer [simulation]](/img/83/73ee7f87787690aef7f0a9dab2c192.jpg)
Temperature measurement and display of 51 single chip microcomputer [simulation]

Tiktok actual combat ~ number of likes pop-up box

内网渗透 | 手把手教你如何进行内网渗透

非路由组件之头部组件和底部组件书写

基于Pyqt5工具栏按钮可实现界面切换-2

基于Pyqt5工具栏按钮可实现界面切换-1
随机推荐
2022年最新最全软件测试面试题大全
详解Promise使用
(毒刺)利用Pystinger Socks4上线不出网主机
4 special cases! Schools in area a adopt the re examination score line in area B!
C MVC creates a view to get rid of the influence of layout
The use of 8255 interface chip and ADC0809
BBR encounters cubic
Win11自动关机设置在哪?Win11设置自动关机的两种方法
"A good programmer is worth five ordinary programmers!"
Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
Cryptography -- the mode of block cipher
“一个优秀程序员可抵五个普通程序员!”
JSON数据传递参数
Arduino - character judgment function
SQL进阶语法
Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
简述中台的常识
理想汽车×OceanBase:当造车新势力遇上数据库新势力
How does win11 turn on visual control? Win11 method of turning on visual control
Eight honors and eight disgraces of the programmer version~