Thursday, February 26, 2015

No form parameters are passed when submitting a form

The problem once identified was so stupid and obvious that for while I felt bad. I should have found it very quickly. Anyway, so what was happening is, I created a login for my new web application and after integrating with Spring security I was not able to login. I changed the log level of Spring security package to TRACE and then found that username and password are passed as empty strings.
Then I checked the request sent from browser and noticed that browser is not sending the params with the request.
Below is my html code of the login form:



I spent some time to figure out what is happening but it was already past midnight so I left it like that and slept.
In morning I looked into the code again and very quickly noticed that the input elements in the html does not have "name" attribute. Ooops !!! Very stupid mistake done by someone who has created many web applications.

But it shows that sometimes simple mistakes like this are hard to find.

~Manish