I am new to spring, I am trying to create a login page with the usage of spring form tags and annotations. But I am getting an error as follows
Here is the code I am trying to use
What I am trying to achieve is on run, the first page that should come is the login page that should be bound to the UserForm, which validates the data against a database and allows the user to login.
Can anyone please tell me what I am missing or where I am going wrong
I tried that too. But problem is that I the login page is the initial page where the form elements are available in the Users class. but problem is the code
is unable to look up for the data. I researched through google and found out that modelAttribute parameter associated with the form was not initialized. What I want to know is that is it required that the landing page should be associated with any bean class?
if the form tag is written as follows
is it required that user attribute be initialized with some values? Because this login page is the initial page only after the user provides some input the data will not be initialized. If spring container takes care of initialization then why this error is coming?
and when i removed the
code and replaced it with normal html text box as inputs, the page opened and i was able to perform login validation through internal coding. This takes away the spring feature and makes it look like tight coupled application.
This will take every ounce of my mental strength! All for a tiny ad: