标签:eth springmvc tde let put ESS get work dde
两个地方需要注意:
第一处在web.xml文件中不要忘记配置
<filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
第二处是在方法开头加上注解@ResponseBody,代码如下所示
@RequestMapping(value="/testRest/{id}",method=RequestMethod.PUT) @ResponseBody public String testRestPut(@PathVariable Integer id){ System.out.println("testRest Put:" + id); return SUCCESS; } @RequestMapping(value="/testRest/{id}",method=RequestMethod.DELETE) @ResponseBody public String testRestDelete(@PathVariable Integer id){ System.out.println("testRest Delete:" + id); return SUCCESS; }
然后就成功了。
使用springmvc时报错JSPs only permit GET POST or HEAD
标签:eth springmvc tde let put ESS get work dde
原文地址:https://www.cnblogs.com/liaoxiaolao/p/9994188.html