I send from form an action to
<form name='recoverForm' action="<c:url value='recover'/>" method='POST'>
spring:
@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
}
But I get error 405 - Request method 'POST' not supported.
Why is it? i send post request
and controller has a post method is not it?
In Spring-security.xml
<csrf />
: Spring Security Cross Site Request Forgery (CSRF) protection blocks it.Token required along with form via POST request.
In form add the following: