Type:
Status ReportMesssage:
HTTP method GET is not supported by this URL
Description: The specified HTTP method is not allowed for the requested resource.
錯誤原因:
1.繼承自HttpServlet的Servlet沒有重寫對于請求和響應的處理方法:doGet或doPost等方法;默認調用父類的doGet或doPost等方法;
2.父類HttpServlet的doGet或doPost等方法覆蓋了你重寫的doGet或doPost等方法;
父類HttpServlet的doGet或doPost等方法的默認實現是返回狀態代碼為405的HTTP錯誤表示對于指定資源的請求方法不被允許。
解決方法:
1.子類重寫doGet或doPost等方法;
2.在你擴展的Servlert中重寫doGet或doPost等方法來處理請求和響應時 不要調用父類HttpServlet的doGet或doPost等方法,即去掉super.doGet(request, response)和 super.doPost(request, response)。
如果子類僅僅重寫的是doGet或doPost其中一個方法,而沒有另一個方法,也會報405錯誤
posted on 2014-02-10 13:32
若愚若怯 閱讀(1080)
評論(0) 編輯 收藏 所屬分類:
錯誤整理