Add thymeleaf-htmx module: Spring Boot 4.1.2 + Thymeleaf 3.1.5 + htmx 2.0.11 CRUD UI with fragment rendering, 422 validation re-render, pagination, inline edit, delete, MockMvc tests and a Chromium check

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
Claude
2026-10-28 18:23:46 +00:00
parent 93c709c34d
commit 99a8a0df42
37 changed files with 1840 additions and 0 deletions
@@ -0,0 +1,79 @@
# deleted the 3 rows on page 5, then the table (which re-fetches page 5 after HX-Trigger) asks for page index 4
# request (curl notation, sent through MockMvc): curl -H 'HX-Request: true' '/contacts?page=4'
HTTP 200
---- body (2602 chars) ----
<div id="contact-table" hx-trigger="contactsChanged from:body" hx-target="this" hx-swap="outerHTML" hx-get="/contacts?page=3">
<table>
<thead><tr><th>Name</th><th>Email</th><th>Role</th><th></th></tr></thead>
<tbody>
<tr id="contact-16">
<td>Pooja Verma</td>
<td>[email protected]</td>
<td>Manager</td>
<td>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-get="/contacts/16/edit">Edit</button>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-delete="/contacts/16" hx-confirm="Delete Pooja Verma?">Delete</button>
</td>
</tr>
<tr id="contact-17">
<td>Qasim Ansari</td>
<td>[email protected]</td>
<td>Developer</td>
<td>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-get="/contacts/17/edit">Edit</button>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-delete="/contacts/17" hx-confirm="Delete Qasim Ansari?">Delete</button>
</td>
</tr>
<tr id="contact-18">
<td>Rohan Sawant</td>
<td>[email protected]</td>
<td>Tester</td>
<td>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-get="/contacts/18/edit">Edit</button>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-delete="/contacts/18" hx-confirm="Delete Rohan Sawant?">Delete</button>
</td>
</tr>
<tr id="contact-19">
<td>Sneha Kamat</td>
<td>[email protected]</td>
<td>Architect</td>
<td>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-get="/contacts/19/edit">Edit</button>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-delete="/contacts/19" hx-confirm="Delete Sneha Kamat?">Delete</button>
</td>
</tr>
<tr id="contact-20">
<td>Tanmay Ghosh</td>
<td>[email protected]</td>
<td>Manager</td>
<td>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-get="/contacts/20/edit">Edit</button>
<button type="button"
hx-target="closest tr" hx-swap="outerHTML" hx-delete="/contacts/20" hx-confirm="Delete Tanmay Ghosh?">Delete</button>
</td>
</tr>
</tbody>
</table>
<nav class="pager" aria-label="Pages">
<a href="/contacts?page=2" hx-target="#contact-table" hx-push-url="true" hx-get="/contacts?page=2">&laquo; Prev</a>
<span>Page 4 of 4 (20 contacts)</span>
</nav>
</div>