4**、`@RequestMapping` **注解的 **method **属性
@RequestMapping注解的method属性通过请求的请求方式(get或post)匹配请求映射。@RequestMapping注解的method属性是一个RequestMethod类型的数组,表示该请求映射能够匹配多种请求方式的请求。若当前请求的请求地址满足请求映射的
value属性,但是请求方式不满足method属性,则浏览器报错
405``:``Request method 'POST' not supp。
测试:
Controller:
@RequestMapping( value = {"/testRequestMapping", "/test"}, method = {RequestMethod.GET, RequestMethod.POST} )public String testRequestMapping(){return "success";}
HTML: ```html 测试@RequestMapping的value属性—>/test
