巴扎黑2017-04-18 10:08:51
So it is recommended to check what the username and password passed by the request are
黄舟2017-04-18 10:08:51
My guess is that there is no jdbc jar package in tomcat. You can post all the logs and let everyone take a look, so that the problem can be found
PHPz2017-04-18 10:08:51
Please think about the following questions:
1.
request.getParameter("userName"); When you pass the parameter, userName is in middle capital letters? I don't see it. name="username"?
2.
The test method only means that there is no problem with your DAO, your database is not connected to the wrong place, and the database table can get data.
3.
Problems often appear at the source. Don’t get hung up on the process. Your process code is very stable. Maybe you didn't get the first step. It was forwarded directly. Have you paid attention? After forwarding, continue running userName="", of course you can't get it, and you didn't return in time.
4.
Just hit a few breakpoints and run for a while, especially when taking parameters. .
巴扎黑2017-04-18 10:08:51
For this kind of problem, use DeBug mode and set more breakpoints, such as selectUser
里边的if
处,还有其他的与相关数据
at locations that may be involved