Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

login servlet = login successful doesn't show  RSS feed

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've tried using a PreparedStatement to verify login userid and password.

My database is using Msaccess and the field for the variable is userid and password. It contains 4 userid and passwords.

However, when I run my servlet, they did not give me the successful login message nor redirect me to the next page. Hope someone can tell me what is wrong with my code. thanks.

 
Sheriff
Posts: 5961
904
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tangara goh wrote:


So, have you ever checked the log?
 
tangara goh
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry but how do I go about checking the log. Even though, I have my friend who helped me to resolve this problem, I still hope to learn how. thanks.
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which server are you using. If it's tomcat, your logs are in the "logs" folder under your tomcat installation directory.

By the way, generating HTML from within your servlet is not the best idea. You may want to read up on MVC.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you intending to look for a record with the hard-coded user name and password rather than the values passed in by the client page?

Note the setString() calls. Your setting the 1st parameter to "userid", not the contents of the userid parameter passed to the servlet. The same problem exists for the second parameter.

I think you want:

What response do you get when you go to the page? Do you get either the Login Success or the Login Failed HTML?
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tangara goh wrote:I am sorry but how do I go about checking the log. Even though, I have my friend who helped me to resolve this problem, I still hope to learn how. thanks.


If you've solved the problem, can you please share the resolution with the rest of us?

Thanks,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!