问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问。可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP method GET is not supported by this URL。的确是继承了HttpServlet,而且是重写了它的doGet()、doPost()方法(注意这两种方法一定要写)
public class SearchServlet extends HttpServlet{ @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub super.doPost(req, resp); } }