Showing posts with label wt lab program. Show all posts
Showing posts with label wt lab program. Show all posts

Friday, 17 February 2017

User authentication in Servlets


A user validation web application, where the user submits the login name and password to the server. The name and password are checked against the data already available in Database and if the data matches, a successful login page is returned. Otherwise a failure message is shown to the user. 

All u need is: 1. Mysql Database
                       2.Its connector.jar file
                       3.Notepad
                       4.Tomcat Server

Let's first create the folder structure in web-apps of tomcat container:






Mysql database file creation




Now we have to write the src code:

1. logp.java
2. Welcome.java
3. home.html



After Compiling the java programs place it in classes folder as shown below:

Place mysql-connector.jar file in lib folder


web.xml file is shown below:


Below image shows u the application uploaded in tomcat:


 This is the output in tomcat