开发者

How does Spring 3 map the form-post in this jsp?

At line 17 of login.jsp, there is the following line of code:

<form action="/login/submit" method="post">

What I can't determine is where Spring submits this form to.

开发者_JS百科

In the corresponding LoginController.java, I don't see any mapping to the URL '/login/submit' such as this:

@RequestMapping(value = "/login/submit", method = RequestMethod.POST)

So how does Spring 3 know what to do with this form action?

UPDATE:

Found this here:

<form-login login-page="/login" login-processing-url="/login/submit" authentication-failure-url="/login/error" />


Spring 3 only "knows" what you tell it to, either through your XML configuration or annotations.

Your question is really "Where do I have /login/submit mapped to a controller?", and without your code, we cannot answer any of this.

Are you using Spring Security, which may have a login-form mapped to this URL? If so, examine your Spring Security context XML file.

Otherwise, turn up DEBUG logging within Spring and upon server startup it will map out each URL that is mapped to each controller.


So the login processing URL takes care of handling this form POST. If you look further in the security context file (most likely the file where you found the form-login element) you should see an authentication manager and a user details service which will tell you how Spring knows which credentials are authentic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜