In this article you will learn how you may design a simple Login form using JSP. We use the session for storing the users information.
Login.jsp page take input from user and submitted to server to further processing. Database has a MYSQL table name users. Users table is having number of fields like username and passwd which are using in login process.

Create a table in the database and name it as users

Add record in table


index.html page







source code


Login.jsp page


Home.jsp page


Logout Page logout.jsp

If you want to logout for current session. You can use the logout page where the session value for current username is removed.