# spring-guides/gs-serving-web-content architecture

> Architecture diagram of the GitHub repository spring-guides/gs-serving-web-content, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spring-guides/gs-serving-web-content
- Repository: https://github.com/spring-guides/gs-serving-web-content

## Overview

This repository is a Spring guide with Java and Kotlin sample applications for serving a static home page and a personalized greeting page. A browser requests `/` for the welcome page or sends a GET to `/greeting`; the controller supplies a default or query-provided name to the view, which renders HTML. The Java and Kotlin samples are parallel implementations. The README documents these relationships; source excerpts were not provided, so implementation-level wiring beyond those statements is not asserted.

Main entry points: [`complete/src/main/java/com/example/servingwebcontent/GreetingController.java`](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/java/com/example/servingwebcontent/GreetingController.java) (Java greeting controller), [`complete/src/main/resources/templates/greeting.html`](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/templates/greeting.html) (Java greeting template), [`complete/src/main/resources/static/index.html`](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/static/index.html) (Java home page), [`complete-kotlin/src/main/kotlin/com/example/servingwebcontent/GreetingController.kt`](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/kotlin/com/example/servingwebcontent/GreetingController.kt) (Kotlin greeting controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_java_controller["Java greeting controller"]
  node_java_template["Java greeting template<br/>[greeting.html]"]
  node_java_home["Java home page<br/>[index.html]"]
  node_kotlin_controller["Kotlin greeting controller"]
  node_kotlin_template["Kotlin greeting template<br/>[greeting.html]"]
  node_kotlin_home["Kotlin home page<br/>[index.html]"]
end

subgraph group_samples["Language samples"]
  node_java_app["Java app"]
  node_kotlin_app["Kotlin app"]
end

node_browser(("Browser"))

node_browser -->|"GET /greeting"| node_java_controller
node_java_controller -->|"provides view data"| node_java_template
node_java_template -->|"renders HTML"| node_browser
node_browser -->|"requests /"| node_java_home
node_java_home -->|"serves HTML"| node_browser
node_browser -->|"GET /greeting"| node_kotlin_controller
node_kotlin_controller -->|"provides view data"| node_kotlin_template
node_kotlin_template -->|"renders HTML"| node_browser
node_browser -->|"requests /"| node_kotlin_home
node_kotlin_home -->|"serves HTML"| node_browser

click node_java_app "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/java/com/example/servingwebcontent/ServingWebContentApplication.java"
click node_java_controller "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/java/com/example/servingwebcontent/GreetingController.java"
click node_java_template "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/templates/greeting.html"
click node_java_home "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/static/index.html"
click node_kotlin_app "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/kotlin/com/example/servingwebcontent/ServingWebContentApplication.kt"
click node_kotlin_controller "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/kotlin/com/example/servingwebcontent/GreetingController.kt"
click node_kotlin_template "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/resources/templates/greeting.html"
click node_kotlin_home "https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/resources/static/index.html"

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_java_controller,node_java_template,node_java_home,node_kotlin_controller,node_kotlin_template,node_kotlin_home,node_browser toneBlue
class node_java_app,node_kotlin_app toneAmber
```

## Components

### Web experience

- [Java greeting controller](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/java/com/example/servingwebcontent/GreetingController.java): `complete/src/main/java/com/example/servingwebcontent/GreetingController.java`
- [Java greeting template](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/templates/greeting.html): `complete/src/main/resources/templates/greeting.html`
- [Java home page](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/resources/static/index.html): `complete/src/main/resources/static/index.html`
- [Kotlin greeting controller](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/kotlin/com/example/servingwebcontent/GreetingController.kt): `complete-kotlin/src/main/kotlin/com/example/servingwebcontent/GreetingController.kt`
- [Kotlin greeting template](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/resources/templates/greeting.html): `complete-kotlin/src/main/resources/templates/greeting.html`
- [Kotlin home page](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/resources/static/index.html): `complete-kotlin/src/main/resources/static/index.html`

### Language samples

- [Java app](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete/src/main/java/com/example/servingwebcontent/ServingWebContentApplication.java): `complete/src/main/java/com/example/servingwebcontent/ServingWebContentApplication.java`
- [Kotlin app](https://github.com/spring-guides/gs-serving-web-content/blob/main/complete-kotlin/src/main/kotlin/com/example/servingwebcontent/ServingWebContentApplication.kt): `complete-kotlin/src/main/kotlin/com/example/servingwebcontent/ServingWebContentApplication.kt`

### Other components

- **Browser**

## Connections

- Browser → Java greeting controller: GET /greeting (evidence: `README.adoc`)
- Java greeting controller → Java greeting template: provides view data (evidence: `README.adoc`)
- Java greeting template → Browser: renders HTML (evidence: `README.adoc`)
- Browser → Java home page: requests / (evidence: `README.adoc`)
- Java home page → Browser: serves HTML (evidence: `README.adoc`)
- Browser → Kotlin greeting controller: GET /greeting (evidence: `README.adoc`)
- Kotlin greeting controller → Kotlin greeting template: provides view data (evidence: `README.adoc`)
- Kotlin greeting template → Browser: renders HTML (evidence: `README.adoc`)
- Browser → Kotlin home page: requests / (evidence: `README.adoc`)
- Kotlin home page → Browser: serves HTML (evidence: `README.adoc`)
