我以前有一个登录表单,如下所示
<div class="span-10 last">
<c:url value="/j_spring_security_check" var="loginActionUrl" />
<user:login actionNameKey="login.login" action="${loginActionUrl}"/>
</div>
但现在我将表格更改为如下所示。
<div class="span-10 last">
<c:url value="/login/loginNow" var="loginActionUrl" />
<user:login actionNameKey="login.login" action="${loginActionUrl}"/>
</div>
我的控制器现在看起来像这样
@Controller
@RequestMapping(value = "/login")
public class LoginPageController {
@RequestMapping(value = "/loginNow", method = RequestMethod.POST)
public String doLogin(
@RequestHeader(value = "referer", required = false) final String referer,
@Valid final LoginForm loginForm, final BindingResult bindingResult,
final Model model, final HttpServletRequest request,
final HttpServletResponse response) throws CMSItemNotFoundException {
if (somethingMissing) {
return to login page.
}
return FORWARD_PREFIX + "/j_spring_security_check";
}
}
但现在我收到不支持请求方法的帖子。我不知道为什么..?我该如何纠正这个错误..谢谢