HTTP Status 405 - Request method 'GET' not supported

springMVC框架中出现这个问题看看web.xml是否配置HiddenHttpMethodFilter

ctrl +shift+T查看这个方法

配置:

<!-- 配置org.springframework.web.filter.HiddenHttpMethodFilter:可以把post请求转为delete或putt请求 -->
   <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>

阅读更多

奇怪的错误HTTP Status 405 - HTTP method GET is not supported by this URL

11-28

package com.flight.servlet;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnimport java.lang.reflect.InvocationTargetException;rnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport java.util.ArrayList;rnimport org.apache.commons.beanutils.BeanUtils;rnrnimport com.flight.bean.City;rnimport com.flight.bean.flight;rnimport com.flight.dao.searchflightDao;rnrnpublic class ticketsearchServlet extends HttpServlet rn rn public void doGet(HttpServletRequest request, HttpServletResponse response, String String)rn throws ServletException, IOException rn rn doPost(request,response);rn rn rnpublic void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rn request.setCharacterEncoding("utf-8");rn rn String action=request.getParameter("action");rn searchflightDao sfdao=new searchflightDao();rn rn if(action.equals("list"))rn rn rn rn String flight_id = request.getParameter("flight_id");rn String datetime = request.getParameter("datetime");rn rn request.setAttribute("fmList", sfdao.findBy(flight_id,datetime));rn rn request.getRequestDispatcher("ticketstatus.jsp").forward(request, response);rn rnrnrn rn public void init() throws ServletException rn // Put your code herern rnrnrn表单的提交方式检查过了是post方式提交的,请高手们帮忙看看是怎么回事?急用啊!!!rn

没有更多推荐了,返回首页