Hi, I have a servlet that basically connects to the database if the userid and password is correct. I have a "login.html" page where the user enters the "userid" and "password".The servlet does the checking and grants access to the user. My question is as follows.As soon as I startup tomcat type in the url login.html,then press the submit button,(both the fields are blank) the servlet says "ok" this is this information is present in the database.It should say "not ok".Hope I question is clear.The code for the servlet is given below.
Regarding the database.The fields in the database are "username" and "password" and it has one tuple "xyz" and "xyz"
Hope that my question is rightly put. Thanking you AS
2 problems: 1) move those 'private' variables into your method. Otherwise, 2 near-concurrent hits to the servlet will walk on each other's values, leading to serious bugs. 2) in the method, initialize username and password to null, not to "" - then it will be closer to what you want.
Joined: Nov 13, 2003
Thanks for the prompt reply.It did work the way you said it.Will keep posting for errors/doubts. AS