GitHunt
NI

nitish312/UserApp

UserApp Servlet JSP Project

UserApp โ€“ Authentication & Access Control using Java Servlets and JSP

A backend-focused mini project built using Java Servlets, JSP, JDBC, and MySQL to strengthen core Java web development fundamentals and understand what happens under the hood of modern frameworks like Spring Boot.


๐Ÿš€ Project Overview

UserApp is a simple authentication and access control system that allows users to register, log in, and view their profile details.
The project demonstrates an end-to-end Java web application flow:

Client โ†’ Servlet โ†’ Service/DAO โ†’ Database โ†’ JSP

This project was built as a fundamentals refresher while primarily working with Spring & Spring Boot, reinforcing how these frameworks are built on top of Servlets and a Servlet container (Tomcat).


โœจ Features

  • ๐Ÿ” User Registration with form handling via Servlets

  • ๐Ÿ—„๏ธ Database persistence using JDBC and MySQL

  • โœ… Login authentication by validating credentials from the database

  • ๐Ÿงพ JSP used for rendering views and displaying user profile data

  • ๐Ÿ”„ Clear separation of layers:

    • Controller (Servlet)
    • Service
    • DAO
    • Model (Entity)

๐Ÿ“ธ Screenshots

Home Page

Image

Register Page

Image

Login Page

Image

User Profile

Image

๐Ÿ› ๏ธ Tech Stack

  • Java (JDK 17)
  • Java Servlets
  • JSP
  • JDBC
  • MySQL
  • Apache Tomcat 10
  • HTML / CSS

๐Ÿ“‚ Project Structure

UserApp
โ”‚
โ”œโ”€โ”€ src/main/java
โ”‚   โ”œโ”€โ”€ com.dao
โ”‚   โ”‚   โ””โ”€โ”€ UserDao.java
โ”‚   โ”œโ”€โ”€ com.entity
โ”‚   โ”‚   โ””โ”€โ”€ User.java
โ”‚   โ”œโ”€โ”€ com.service
โ”‚   โ”‚   โ””โ”€โ”€ UserService.java
โ”‚   โ”œโ”€โ”€ com.servlet
โ”‚   โ”‚   โ”œโ”€โ”€ RegisterServlet.java
โ”‚   โ”‚   โ”œโ”€โ”€ LoginServlet.java
โ”‚   โ”‚   โ””โ”€โ”€ LoginFormServlet.java
โ”‚   โ””โ”€โ”€ com.util
โ”‚       โ””โ”€โ”€ JDBC_Util.java
โ”‚
โ”œโ”€โ”€ src/main/webapp
โ”‚   โ”œโ”€โ”€ home.jsp
โ”‚   โ”œโ”€โ”€ login.jsp
โ”‚   โ”œโ”€โ”€ register.jsp
โ”‚   โ”œโ”€โ”€ profile.jsp
โ”‚   โ””โ”€โ”€ WEB-INF
โ”‚       โ””โ”€โ”€ web.xml
โ”‚
โ””โ”€โ”€ lib
    โ””โ”€โ”€ mysql-connector-j.jar

โš™๏ธ Application Flow

  1. User registers via register.jsp
  2. Data is handled by RegisterServlet
  3. Data is persisted using UserDao (JDBC)
  4. User logs in via login.jsp
  5. Credentials are validated against the database
  6. On success, user details are forwarded to profile.jsp
  7. On failure, an error message is displayed

๐Ÿง  Why This Project?

Although frameworks like Spring Boot improve productivity, they are built on the same core concepts:

  • Servlets
  • Request lifecycle
  • Filters
  • Sessions
  • MVC pattern

Working directly with Servlets and JSP helps in:

  • โœ”๏ธ Better debugging of production issues
  • โœ”๏ธ Clear understanding of request/response lifecycle
  • โœ”๏ธ Writing cleaner, more efficient Spring Boot applications

Strong fundamentals make better engineers.


โ–ถ๏ธ How to Run

  1. Clone the repository
  2. Import the project into Eclipse / IntelliJ
  3. Configure Apache Tomcat 10
  4. Create a MySQL database and users table
  5. Update DB credentials in JDBC_Util.java
  6. Deploy and run the application

๐Ÿ‘จโ€๐Ÿ’ป Author

Nitish Chintakindi :
Java Backend Developer | Spring & Spring Boot
Focused on building scalable and maintainable systems


โญ If you find this useful, feel free to star the repository!