spring MVC之RequestMapping

@RequestMapping(path = "/hello",params = {"username=111"},method = RequestMethod.POST,headers = {"accept"})

RequestMapping的属性

  1. value=path:映射的路径,如果只有一个值也可以省略
  2. params:限制链接所带的参数,如上代码规定参数中必须有username=111,即链接的形式为www.xxx.com?username=111
  3. mathod:限制请求的方式,为post或get
  4. header:限制头部必须携带的参数
posted @ 2020-01-17 09:54  开局一把刀  阅读(5)  评论(0)    收藏  举报