springMVC出現HTTP Status 405 - Request method ‘GET’ not supported錯誤的解決方法
1.加入 @ResponseBody 註解或者加入isErrorPage=“true”。
@RequestMapping(value="/order/{id}",method=RequestMethod.DELETE)
@ResponseBody
<%@ page contentType="text/html;charset=UTF-8" language="java"
isErrorPage="true"%>
個人認爲這種治標不治本,因爲返回的只是一個字符串或者是json,而不能正確的讓編譯器知道
2.請求先轉給一個Controller,再返回jsp頁面。
3.tomcat換到7.0以及以下版本。(強烈推薦)