I am creating a login application using spring mvc and ibatis. But i am getting a NPE and i am not able to solve this issue from the past 2 days . Please help me.
My Form controller is
My spring application context file is:
My ibatis configuration file is:
and my SqlMapConfig file is:
My console prints the following and i can make out the username is null so i am getting this NPE. But why does it print the password that the user entered and not the username? Can anybody please explain where i am going wrong?
Please help me as i am stuck here and i don't have any idea as to why i am getting this error.Thank you
In your posted code, line 57 is blank, but the NPE occurs on line 57, can you post that line of code?
EDIT: Can you also post your command class and JSP file?
P:S: Still extending SimpleFormController in the spring3 era? I would suggest you to use annotations instead, which makes is more powerful and simpler.
change this line <input type="text" name="name" id="name" />
to <input type="text" name="userId" id="userId" /> and you should get the user entered id, in the controlller, for spring to bind them, you should have same name in both command class as well as JSP.
EDIT: either you can do the above change, or have objUserLogin.getName in your controller instead of objUserLogin.getUserId() on line 57.