@@ -93,19 +93,19 @@ sequenceDiagram
9393 C->>U: index.html
9494
9595 U->>C: GET /add-product
96- C->>U: add-product .html
96+ C->>U: addproduct .html
9797
9898 U->>C: POST /add-product
9999 C->>S: saveProduct(product)
100100 S->>R: save(product)
101101 R->>DB: INSERT
102- C->>U: redirect to /
102+ C->>U: redirect:/
103103
104104 U->>C: GET /display-products?category=...
105105 C->>S: getProducts(...)
106106 S->>R: findByCategory() OR findAll()
107107 R->>DB: SELECT
108- C->>U: display-products .html
108+ C->>U: displayproduct .html
109109```
110110
111111---
143143 │ └── resources/
144144 │ ├── templates/
145145 │ │ ├── index.html
146- │ │ ├── add-product .html
147- │ │ └── display-products .html
146+ │ │ ├── addproduct .html
147+ │ │ └── displayproduct .html
148148 │ ├── application.properties
149149 │ └── static/
150150 │
@@ -158,10 +158,10 @@ src/
158158
159159| URL | Method | Description | View |
160160| -----| --------| -------------| -------|
161- | ` / ` | GET | Homepage | index.html |
162- | ` /add-product ` | GET | Show product form | add-product.html |
161+ | ` / ` | GET | Homepage | index |
162+ | ` /add-product ` | GET | Show product form | addproduct |
163163| ` /add-product ` | POST | Save new product | redirect:/ |
164- | ` /display-products ` | GET | Display all or filtered by category | display-products.html |
164+ | ` /display-products ` | GET | Display all or filtered | displayproduct |
165165
166166---
167167
213213
214214| Key | Value |
215215| -----| -------|
216- | JDBC URL | jdbc:h2:mem: productdb |
216+ | JDBC URL | jdbc:h2:mem: productdb ;DB_CLOSE_ON_EXIT=FALSE |
217217| Username | sa |
218218| Password | * (empty)* |
219219
225225Caused by template naming mismatch.
226226Ensure:
227227```
228- add-product.html == return "add-product"
229- display-products.html == return "display-products"
228+ return "addproduct"; → templates/addproduct.html
229+ return "displayproduct"; → templates/displayproduct.html
230230```
231231
232232### ⚠ H2 Shutdown Error
@@ -242,4 +242,4 @@ MIT License.
242242
243243---
244244
245- ✨ * This README is crafted to be professional, recruiter‑friendly, and portfolio‑ready — showcasing your Spring IOC, DI, MVC, JPA, and Thymeleaf skills in the best possible way. *
245+
0 commit comments