views:

139

answers:

2

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.

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" />
+2  A: 

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.

matt b
@mattb: Yes, I just found a security reference. I will update the question.
pnut butter
+1  A: 

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.

Jatin