Skip to content

A simple login web page using JSP, built with NetBeans. This repository demonstrates basic user authentication by validating login credentials with a JSP file. The web application is locally hosted using the Apache Tomcat server and uses MySQL as the database.

Notifications You must be signed in to change notification settings

TDR-VOID/LoginForm_JSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSP User Authentication Demo

Introduction

This repository contains a simple web-based login form for user authentication. The web application is designed to demonstrate the fundamental concepts of user login functionality. Built using Java Server Pages (JSP) and the NetBeans Integrated Development Environment (IDE), this project serves as a practical example of integrating server-side scripting with a relational database. The application is hosted locally using the Apache Tomcat server, making it easy to deploy and test in a development environment.

The repository includes two versions of the login page:

  1. Login_JSP: This version uses a hardcoded user email and password for authentication.

  2. Login_JSP_MySQL: This version uses a MySQL database to store and authenticate user emails and passwords. MySQL is run using XAMPP.

Screenshots of the Web Pages
Home_Page Login_Page Configure Apache Tomcat

Screenshots and steps for setting up the project and connecting the Tomcat server with NetBeans are provided in the setup section below.

Setup

Initial Project Setup and Connecting Tomcat Server with NetBeans


  1. Download and Install NetBeans:
  • Download the latest version of NetBeans from the official website.
  • Follow the installation instructions provided.
  1. Download and Install Apache Tomcat:
  • Download Apache Tomcat from the official website.
  • Extract the downloaded ZIP file to a preferred location on your system.
  1. Configure Apache Tomcat in NetBeans:
  • Open NetBeans.
  • Go to Tools > Servers.
  • Click the "Add Server" in the Servers window.
  • Choose Apache Tomcat and specify the location of your Tomcat installation.
  • Complete the configuration by following the on-screen instructions.
Configure Apache Tomcat
Configure Apache Tomcat

Setting Up MySQL Database


  1. Download and Install XAMPP:
  • Download XAMPP from the official website.
  • Follow the installation instructions provided.
  1. Start MySQL:
  • Open XAMPP Control Panel.
  • Start the MySQL service.
  1. Create and Populate the Database:
  • Open phpMyAdmin from the XAMPP Control Panel.
  • Create a new database named userdb.
  • Run the following SQL queries to create and populate the users table:
CREATE DATABASE userdb;

USE userdb;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    email VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL
);

INSERT INTO users (email, password) VALUES ('user@example.com', 'password123');

Project Structure

  1. Login_JSP:
  • Contains a simple login form with hardcoded user credentials.
  • No database connection is used.
  1. Login_JSP_MySQL:
  • Connects to a MySQL database to validate user credentials.
  • Uses JDBC to interact with the database.

Running the Application

  1. Deploying on Apache Tomcat:
  • Open the project in NetBeans.
  • Right-click on the project and select Run.
  • The project will be deployed on the Apache Tomcat server.
Run project in NetBeans
Run project in NetBeans
  1. Accessing the Login Page:

Additional Notes

  • Ensure the MySQL JDBC driver (mysql-connector-java-...jar) is added to your project's WEB-INF/lib directory.
  • Update the database connection details (URL, username, password) in the Validation.jsp file according to your MySQL setup.
  • Follow the setup instructions carefully to get the project running on your local machine.

About

A simple login web page using JSP, built with NetBeans. This repository demonstrates basic user authentication by validating login credentials with a JSP file. The web application is locally hosted using the Apache Tomcat server and uses MySQL as the database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages