Spring MVC请求参数接收
1.通过@RequestParam 接收请求参数
2.使用pojo对请求参数进行对象绑定
请求:http://127.0.0.1:8080//MySpringMVC01/user/save?userName=jack&userAge=11&address.province=anhui&address.city=chuzhou
POJO User:
public class User { private String userName; private Integer userAge; private Address address; // ........... }
POJO Address:
public class Address { private String province; private String city; //......... }
4.通过@RequestHeader 绑定请求报头属性值
[email protected] 接收请求中的cookie值
时间: 2024-10-07 12:30:28