Tag: http status code 405

SpringMVC HTTP状态405 – 不支持请求方法“POST”

我有一个表单,我从该表单查询数据库,并发布到另一个页面与结果。 然后我从查询结果中选择一条记录,它将我带回到我进行查询的页面,以便我可以更新记录。 我点击更新,它将我带回控制器并使用相同的方法首先调用查询,但是请求的参数现在是’更新’,所以假设转到方法中的更新条件。 好像我无法将页面重新提交到相同的url映射。 调节器 @RequestMapping(value=”citizen_registration.htm”, method = RequestMethod.POST) public ModelAndView handleRequest(@Valid @ModelAttribute Citizens citizen, BindingResult result, ModelMap m, Model model, @RequestParam(value=”user_request”) String user_request) throws Exception { try{ logger.debug(“In Http method for CitizenRegistrationController – Punishment Registration”); logger.debug(“User Request Is ” + user_request); if(result.hasErrors()){ //handle errors // return new ModelAndView(“citizen_registration”); }else{ //check if its a save […]

HTTP状态405 – 此URL不支持HTTP方法POST

我收到错误HTTP Status 405 – HTTP method POST is not supported by this URL当我使用以下代码时HTTP Status 405 – HTTP method POST is not supported by this URL (下面)…导致问题的行(显然)是getServletContext().getRequestDispatcher(“/EditObject?id=”+objId).forward(request, response); package web.objects; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import dao.ObjDetailsDao; @SuppressWarnings(“serial”) public class EditObjectText extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse […]