# jyp0t0/jsp architecture

> Architecture diagram of the GitHub repository jyp0t0/jsp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jyp0t0/jsp
- Repository: https://github.com/jyp0t0/jsp

## Overview

This repository is a set of JSP and Java web-development chapter examples, not one integrated application. Its broad workflow progresses from rendered pages and HTTP/session concepts to servlet handling, persistence, and web features such as AJAX, uploads, and email. The clearest implemented layered workflow is ch10 user registration/listing: controllers use a service, which delegates to a DAO using a DTO and database helper. Other chapter capabilities are represented as separate examples; the README provides no further product detail, and unsampled links are omitted.

Main entry points: [`ch10/src/main/java/controller/user1`](https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/java/controller/user1) (User controllers), [`ch10/src/main/java/dao/User1DAO.java`](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/dao/User1DAO.java) (User DAO), [`ch10/src/main/java/service/User1Service.java`](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/service/User1Service.java) (User service), [`ch09/src/main/java/sub1`](https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub1) (Servlet examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["JSP foundations"]
  node_basics["JSP page basics"]
  node_scriptlets["Scriptlets and directives"]
  node_scopes["Request and session"]
  node_jsp_tags["JSP action tags"]
  node_sessions["Cookie login"]
  node_el_jstl["EL and JSTL"]
end

subgraph group_web["Web interaction"]
  node_servlets["Servlet examples"]
  node_filters["Request filters"]
  node_listeners["Session listeners"]
end

subgraph group_features["Web capabilities"]
  node_jdbc_ajax["JDBC and AJAX"]
  node_files_email["Files and email"]
end

subgraph group_mvc["MVC persistence"]
  node_mvc_entry["MVC controllers"]
  node_user_controllers["User controllers"]
  node_user_views["User JSP views"]
  node_user_service["User service<br/>[User1Service.java]"]
  node_user_dao["User DAO<br/>[User1DAO.java]"]
  node_user_dto["User data object<br/>[User1DTO.java]"]
  node_db_helper["Database helper<br/>[DBHelper.java]"]
end

node_visitor(("Browser user"))
node_datasource[("JNDI datasource")]

node_visitor -.->|"requests pages"| node_basics
node_visitor -.->|"requests pages"| node_scriptlets
node_visitor -.->|"uses examples"| node_scopes
node_visitor -.->|"uses examples"| node_jsp_tags
node_visitor -.->|"uses examples"| node_sessions
node_visitor -.->|"uses examples"| node_jdbc_ajax
node_visitor -.->|"uses examples"| node_files_email
node_visitor -.->|"uses examples"| node_el_jstl
node_visitor -.->|"requests servlet"| node_servlets
node_visitor -.->|"requests endpoints"| node_filters
node_visitor -.->|"creates session"| node_listeners
node_visitor -.->|"requests controller"| node_mvc_entry
node_visitor -.->|"submits user data"| node_user_controllers
node_servlets -->|"links to routes"| node_visitor
node_user_controllers -->|"calls service"| node_user_service
node_user_controllers -->|"creates DTO"| node_user_dto
node_user_controllers -->|"queries users"| node_user_service
node_user_controllers -->|"forwards to view"| node_user_views
node_user_service -->|"delegates CRUD"| node_user_dao
node_user_dao -->|"maps records"| node_user_dto
node_user_dao -->|"uses connection helper"| node_db_helper
node_db_helper -->|"looks up"| node_datasource

click node_basics "https://github.com/jyp0t0/jsp/tree/main/ch01/src/main/webapp"
click node_scriptlets "https://github.com/jyp0t0/jsp/tree/main/ch02/src/main/webapp"
click node_scopes "https://github.com/jyp0t0/jsp/tree/main/ch03/src/main/webapp"
click node_jsp_tags "https://github.com/jyp0t0/jsp/tree/main/ch04/src/main/webapp"
click node_sessions "https://github.com/jyp0t0/jsp/tree/main/ch05/src/main/webapp"
click node_jdbc_ajax "https://github.com/jyp0t0/jsp/tree/main/ch06/src/main/webapp"
click node_files_email "https://github.com/jyp0t0/jsp/tree/main/ch07/src/main/webapp"
click node_el_jstl "https://github.com/jyp0t0/jsp/tree/main/ch08/src/main/webapp"
click node_servlets "https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub1"
click node_filters "https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub2"
click node_listeners "https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub3"
click node_mvc_entry "https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/java/controller"
click node_user_controllers "https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/java/controller/user1"
click node_user_views "https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/webapp/WEB-INF/user1"
click node_user_service "https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/service/User1Service.java"
click node_user_dao "https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/dao/User1DAO.java"
click node_user_dto "https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/dto/User1DTO.java"
click node_db_helper "https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/util/DBHelper.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_basics,node_scriptlets,node_scopes,node_jsp_tags,node_sessions,node_el_jstl,node_visitor toneBlue
class node_servlets,node_filters,node_listeners,node_datasource toneAmber
class node_jdbc_ajax,node_files_email toneMint
class node_mvc_entry,node_user_controllers,node_user_views,node_user_service,node_user_dao,node_user_dto,node_db_helper toneRose
```

## Components

### JSP foundations

- [JSP page basics](https://github.com/jyp0t0/jsp/tree/main/ch01/src/main/webapp): `ch01/src/main/webapp`
- [Scriptlets and directives](https://github.com/jyp0t0/jsp/tree/main/ch02/src/main/webapp): `ch02/src/main/webapp`
- [Request and session](https://github.com/jyp0t0/jsp/tree/main/ch03/src/main/webapp): `ch03/src/main/webapp`
- [JSP action tags](https://github.com/jyp0t0/jsp/tree/main/ch04/src/main/webapp): `ch04/src/main/webapp`
- [Cookie login](https://github.com/jyp0t0/jsp/tree/main/ch05/src/main/webapp): `ch05/src/main/webapp`
- [EL and JSTL](https://github.com/jyp0t0/jsp/tree/main/ch08/src/main/webapp): `ch08/src/main/webapp`

### Web interaction

- [Servlet examples](https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub1): `ch09/src/main/java/sub1`
- [Request filters](https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub2): `ch09/src/main/java/sub2`
- [Session listeners](https://github.com/jyp0t0/jsp/tree/main/ch09/src/main/java/sub3): `ch09/src/main/java/sub3`

### Web capabilities

- [JDBC and AJAX](https://github.com/jyp0t0/jsp/tree/main/ch06/src/main/webapp): `ch06/src/main/webapp`
- [Files and email](https://github.com/jyp0t0/jsp/tree/main/ch07/src/main/webapp): `ch07/src/main/webapp`

### MVC persistence

- [MVC controllers](https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/java/controller): `ch10/src/main/java/controller`
- [User controllers](https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/java/controller/user1): `ch10/src/main/java/controller/user1`
- [User JSP views](https://github.com/jyp0t0/jsp/tree/main/ch10/src/main/webapp/WEB-INF/user1): `ch10/src/main/webapp/WEB-INF/user1`
- [User service](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/service/User1Service.java): `ch10/src/main/java/service/User1Service.java`
- [User DAO](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/dao/User1DAO.java): `ch10/src/main/java/dao/User1DAO.java`
- [User data object](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/dto/User1DTO.java): `ch10/src/main/java/dto/User1DTO.java`
- [Database helper](https://github.com/jyp0t0/jsp/blob/main/ch10/src/main/java/util/DBHelper.java): `ch10/src/main/java/util/DBHelper.java`

### Other components

- **Browser user**
- **JNDI datasource**

## Connections

- Browser user → JSP page basics: requests pages
- Browser user → Scriptlets and directives: requests pages
- Browser user → Request and session: uses examples
- Browser user → JSP action tags: uses examples
- Browser user → Cookie login: uses examples
- Browser user → JDBC and AJAX: uses examples
- Browser user → Files and email: uses examples
- Browser user → EL and JSTL: uses examples
- Browser user → Servlet examples: requests servlet
- Browser user → Request filters: requests endpoints
- Browser user → Session listeners: creates session
- Browser user → MVC controllers: requests controller
- Browser user → User controllers: submits user data
- Servlet examples → Browser user: links to routes (evidence: `ch09/src/main/java/sub1/HelloServlet.java`)
- User controllers → User service: calls service (evidence: `ch10/src/main/java/controller/user1/RegisterController.java`)
- User controllers → User data object: creates DTO (evidence: `ch10/src/main/java/controller/user1/RegisterController.java`)
- User controllers → User service: queries users (evidence: `ch10/src/main/java/controller/user1/ListController.java`)
- User controllers → User JSP views: forwards to view (evidence: `ch10/src/main/java/controller/user1/ListController.java`)
- User service → User DAO: delegates CRUD (evidence: `ch10/src/main/java/service/User1Service.java`)
- User DAO → User data object: maps records (evidence: `ch10/src/main/java/dao/User1DAO.java`)
- User DAO → Database helper: uses connection helper (evidence: `ch10/src/main/java/dao/User1DAO.java`)
- Database helper → JNDI datasource: looks up (evidence: `ch10/src/main/java/util/DBHelper.java`)
