HttpServlet:此URL不支持HTTP方法POST ——问题解决

让servlet中的doGet执行doPost方法,会报错,

去掉super就可以了。

具体原因:点我查看具体原因

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doPost(req,resp);加上super就会报错,
		doPost(req, resp);		  去掉super就可以了;
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//�����ַ�����
		req.setCharacterEncoding("utf-8");
		resp.setContentType("text/html;charset=utf-8");
		..................
		..................

你可能感兴趣的:(JavaWeb)