This project is a Mini online store web application built using Java Servlets, JSP, and Tomcat. It demonstrates core web application concepts such as request/response handling, session management, authentication, multithreading, logging, filters and design principles such as MVC, SOLID, KISS princples.
The application runs entirely in memory — no database is required. Products and users are predefined and stored in memory for simplicity.
Java JDK 17+ (or compatible version)
Apache Tomcat 10+ (Servlet API 5, Jakarta EE)
A web browser
Clone or download the project source.
Import the project into your IDE (Eclipse recommended) as a Dynamic Web Project.
Configure Tomcat in your IDE or deploy the generated WAR file to Tomcat’s server or run the application on the IDE.
http://localhost:8080/mini-ecommerce
Simple landing page with navigation links (catalog, login, logout).
Predefined users stored in memory.
Login/Logout functionality with password hashing features.
Session management ensures only logged-in users can access cart and checkout.
In-memory product list with ID, name, description, and base price.
Displayed in JSP with user-friendly formatting.
Clicking a product shows detailed info.
Search bar to filter products by name.
Add/remove items from cart.
Cart persists within user session.
Form for user details (name, email, address).
Order confirmation page.
Cart is cleared after successful checkout.
Implemented using a Filter.
Logs request URL, User-Agent (browser type), and timestamp.
Prices adjusted based on browser type:
Chrome → +10%
Firefox → −5%
Safari → +15%
Others → base price
Controllers (Servlets) handle requests.
Models represent domain objects (Product, User, CartItem, etc.).
Views (JSP) only render data without containing business logic.
Cart is stored in the user’s session (per logged-in user).
Since this is a prototype, scalability concerns (e.g., distributed session management) are not addressed.
No database is used.
Products and users are initialized in memory at application startup.
Implemented centrally through a utility (PricingUtil) so JSPs do not contain logic, keeping MVC principles intact.
Implemented via a Filter to ensure every request is logged automatically.