1. Standard HTTP request Header
2 mapping request parameters, request method, or request header 2.1 knowledge points
- @RequestMapping can use request methods, request parameters, and request header mapping requests in addition to request URL mapping requests
- @RequestMapping Vaule, method, params and Heads table request URL, request methods, request parameters and the mapping conditions of the request header, they are "with" the relationship between them, using multiple conditions together to make the request mapping more accurate
2.2 Test Method Property 2.2.1 Controller class
@RequestMapping(value="/testMethod",method=RequestMethod.POST)
public String testMethod(){
System.out.println("testMethod");
return "success";
}
2.2.2 Request
- Hyperlinks are using GET requests, so they will not succeed
<a href="springmvc/testMethod">测试方法请求</a>
<form action="springmvc/testMethod" method="post">
<input type="submit" value="提交">
</form>
Donate US
The Mentor Studio has been working to help programmers learn to program more quickly and easily, and if you agree with our results and feel helpful, you are welcome to donate ^_^ to us.
03-springmvc_requestmapping_ Request method