2
我从形式发送到春:状态405.请求方法 'POST' 不支持
<form name='recoverForm' action="<c:url value='recover'/>" method='POST'>
春天行动:
@Controller
@RequestMapping(value = "recover")
public class RecoverController {
@RequestMapping(method = RequestMethod.GET)
public String recoverPage(Map<String, Object> model) {
return "recover"; //this works
}
@RequestMapping(method = RequestMethod.POST)
public String recover(Map<String, Object> model) {
System.out.println("_____________recover in action");
return "home"; //error 405
}
,但我得到错误405 - 请求方法 'POST' 不支持的。
为什么呢?我发送post request
和控制器有一个post方法是不是?
贵'GET'工作? – timothyclifford
@timothyclifford是的,它的工作原理 – thinker
当你的应用程序启动时,你能看到映射到日志中的POST路由吗? – timothyclifford