出错情况:一个简单的表单修改,保存后报405错误,查看详细情况显示HTTP method POST is not supported by this URL,确定是表单post提交出的问题,转而查看后端Servlet部分,发现问题
出错代码部分
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}
将其改为
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
this.doGet(req, resp);
}
运行正常