How pthao4/assignment works
Project type and purpose
• This is a classic full-stack Java web application (Lipstick Store) implemented with JSP/Servlets on Apache Tomcat, following an MVC pattern, with a MySQL back end.
• Purpose: provide online cosmetics shopping for customers and an admin portal for product/order/user management.
File structure
• Top-level:
• shop/src/java – Java source code organized into packages:
– controller (Servlets as Controllers)
– dao (Data Access Objects)
– models (POJOs for domain entities)
– filter (Servlet Filters for authentication/authorization)
– DBContext (utility to acquire JDBC connections)
• shop/web & shop/build/web – JSP pages and static assets (HTML/CSS/JS/images)
• shop/lib – third-party JARs (JSTL, JDBC driver, JavaMail)
• build.xml & Ant scripts – build and deployment automation
• Configuration: web.xml (servlet mappings, filter chains), context.xml (JNDI/DataSource), MANIFEST.MF
README for additional insights
• MVC architecture, JDBC connectivity to MySQL, client-side uses Bootstrap/jQuery, server-side uses JavaMail for password/email notifications, two user roles (customer, admin), external payment (COD or card).
a. Main components
• Client Tier: Web Browser (renders HTML/CSS/JS)
• Web Tier (Apache Tomcat):
– Presentation Layer: JSP pages + static assets
– Controller Layer: Servlet controllers + Filters
– Business/Data Layer: DAO classes + DBContext utility
• Data Tier: MySQL database
• External Services:
– SMTP Mail Server (JavaMail)
– (Optionally) Payment Gateway API
b. Relationships and interactions
1. Browser ↔ HTTP requests/responses ↔ Tomcat
2. Filters intercept requests → enforce security/auth
3. Servlets (controllers) handle URLs → call DAOs
4. DAOs use JDBC (DBContext) → execute SQL on MySQL
5. Controllers forward to JSP → JSP + JSTL render view → browser
6. For email/password reset, JavaMail connects to SMTP
c. Architectural patterns/design principles
• MVC (Separation of concerns between View–Controller–Model)
• DAO pattern for data access abstraction
• Filter chain for cross-cutting concerns (authentication/authorization)
• Layered architecture (Presentation → Business → Data)
d. Relevant technologies/frameworks
• Java Servlet API, JSP, JSTL
• JDBC via DBContext, MySQL connector
• Apache Tomcat (Servlet container)
• Bootstrap, jQuery on front end
• JavaMail for email features
• Ant for build/deploy