• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Always responding invalidLogin.jsp

 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am trying to create login page. But it is always responding with invalid.jsp whether there is user in database or not. Please check my as follow:

1). LoginPage.jsp


2). LoginServlet



3). UserBean


4). UserDAO



5). ConnectionManager



If username is available then it should call userLogged.jsp, instead it always calling invalidLogin.jsp.

Can anyone help me?

Thanking You,
Kasparov
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most like scenario is that the User.isValid() method isn't returning what you expect. What have you done to debug this?
 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My observation says it always getting null value for inserted username and password parameters. Since I am trying to find exact problem but not getting. Can you help me?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have determined that the getParameter calls are returning null? How have you ascertained this?
 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more important thing I have found is

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Log In failed: An Exception has occurred! java.lang.NullPointerException

I am using netbeans. I guess mysql driver is inbuilt in netbeans. I don't know why I am getting this to exception.
 
Kasparov Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I have found solution. I just have to add in libraries. Now it's working. Thanks for help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the IDE is getting in the way, work outside of it to find out what is wrong. Generally, you need to provide the JDBC driver jar yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic