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:
@@ -0,0 +1,45 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
/** The persistent record. The form is a separate type ({@link ContactForm}) so that
|
||||
* validation rules and request binding never touch the entity. */
|
||||
@Entity
|
||||
public class Contact {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false, unique = true)
|
||||
private String email;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String role;
|
||||
|
||||
protected Contact() { }
|
||||
|
||||
public Contact(String name, String email, String role) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public void apply(ContactForm form) {
|
||||
this.name = form.getName();
|
||||
this.email = form.getEmail();
|
||||
this.role = form.getRole();
|
||||
}
|
||||
|
||||
public Long getId() { return id; }
|
||||
public String getName() { return name; }
|
||||
public String getEmail() { return email; }
|
||||
public String getRole() { return role; }
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/contacts")
|
||||
class ContactController {
|
||||
|
||||
static final int PAGE_SIZE = 5;
|
||||
|
||||
private final ContactRepository repo;
|
||||
|
||||
ContactController(ContactRepository repo) {
|
||||
this.repo = repo;
|
||||
}
|
||||
|
||||
// ---- list + search + pagination: one handler, two representations ----------------------
|
||||
|
||||
@GetMapping
|
||||
String list(@RequestParam(defaultValue = "") String q,
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
Model model, HttpServletRequest request) {
|
||||
Page<Contact> result = find(q, page);
|
||||
if (page > 0 && result.getTotalPages() > 0 && page >= result.getTotalPages()) {
|
||||
// Page.getNumber() echoes the requested index even past the end, so compare against
|
||||
// getTotalPages(). Clamp to the last page (what happens after deleting its last row).
|
||||
result = find(q, result.getTotalPages() - 1);
|
||||
}
|
||||
model.addAttribute("page", result);
|
||||
model.addAttribute("q", q);
|
||||
model.addAttribute("selfUrl", url(q, result.getNumber()));
|
||||
model.addAttribute("prevUrl", result.hasPrevious() ? url(q, result.getNumber() - 1) : null);
|
||||
model.addAttribute("nextUrl", result.hasNext() ? url(q, result.getNumber() + 1) : null);
|
||||
return Htmx.wantsFragment(request) ? "contacts/list :: table" : "contacts/list";
|
||||
}
|
||||
|
||||
/** Built here, not in the template, so an empty search never produces "?q=&page=1". */
|
||||
private static String url(String q, int page) {
|
||||
return UriComponentsBuilder.fromPath("/contacts")
|
||||
.queryParamIfPresent("q", q.isBlank() ? java.util.Optional.empty() : java.util.Optional.of(q))
|
||||
.queryParam("page", page)
|
||||
.encode().build().toUriString();
|
||||
}
|
||||
|
||||
private Page<Contact> find(String q, int page) {
|
||||
Pageable pageable = PageRequest.of(Math.max(page, 0), PAGE_SIZE, Sort.by("name").and(Sort.by("id")));
|
||||
return q.isBlank()
|
||||
? repo.findAll(pageable)
|
||||
: repo.findByNameContainingIgnoreCaseOrEmailContainingIgnoreCase(q, q, pageable);
|
||||
}
|
||||
|
||||
// ---- create -----------------------------------------------------------------------------
|
||||
|
||||
@GetMapping("/new")
|
||||
String newForm(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("contactForm", new ContactForm());
|
||||
return Htmx.wantsFragment(request) ? "contacts/new :: form" : "contacts/new";
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
Object create(@Valid @ModelAttribute ContactForm contactForm, BindingResult errors,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
if (repo.existsByEmailIgnoreCase(contactForm.getEmail() == null ? "" : contactForm.getEmail())) {
|
||||
errors.rejectValue("email", "duplicate", "That email is already in the list");
|
||||
}
|
||||
if (errors.hasErrors()) {
|
||||
response.setStatus(HttpStatus.UNPROCESSABLE_ENTITY.value());
|
||||
return Htmx.wantsFragment(request) ? "contacts/new :: form" : "contacts/new";
|
||||
}
|
||||
repo.save(newContact(contactForm));
|
||||
if (Htmx.wantsFragment(request)) {
|
||||
// htmx follows HX-Redirect with a full page navigation
|
||||
return ResponseEntity.ok().header("HX-Redirect", "/contacts").build();
|
||||
}
|
||||
return "redirect:/contacts"; // classic post-redirect-get for plain browsers
|
||||
}
|
||||
|
||||
private static Contact newContact(ContactForm f) {
|
||||
Contact c = new Contact(f.getName(), f.getEmail(), f.getRole());
|
||||
return c;
|
||||
}
|
||||
|
||||
// ---- inline edit: three row states (read, edit, edit-with-errors) ------------------------
|
||||
|
||||
@GetMapping("/{id}")
|
||||
String row(@PathVariable Long id, Model model) {
|
||||
model.addAttribute("contact", load(id));
|
||||
return "contacts/fragments :: row";
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/edit")
|
||||
String editRow(@PathVariable Long id, Model model) {
|
||||
Contact c = load(id);
|
||||
model.addAttribute("contact", c);
|
||||
model.addAttribute("contactForm", ContactForm.of(c));
|
||||
return "contacts/fragments :: editRow";
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
String update(@PathVariable Long id, @Valid @ModelAttribute ContactForm contactForm,
|
||||
BindingResult errors, Model model, HttpServletResponse response) {
|
||||
Contact c = load(id);
|
||||
model.addAttribute("contact", c);
|
||||
String email = contactForm.getEmail() == null ? "" : contactForm.getEmail();
|
||||
if (repo.existsByEmailIgnoreCaseAndIdNot(email, id)) {
|
||||
errors.rejectValue("email", "duplicate", "That email is already in the list");
|
||||
}
|
||||
if (errors.hasErrors()) {
|
||||
response.setStatus(HttpStatus.UNPROCESSABLE_ENTITY.value());
|
||||
return "contacts/fragments :: editRow";
|
||||
}
|
||||
c.apply(contactForm);
|
||||
repo.save(c);
|
||||
return "contacts/fragments :: row";
|
||||
}
|
||||
|
||||
// ---- delete -----------------------------------------------------------------------------
|
||||
|
||||
/** 200 with an empty body, NOT 204: htmx 2 does not swap a 204, so the row would stay.
|
||||
* HX-Trigger tells the table to refresh itself so the pager and page contents stay honest. */
|
||||
@DeleteMapping("/{id}")
|
||||
ResponseEntity<Void> delete(@PathVariable Long id) {
|
||||
load(id);
|
||||
repo.deleteById(id);
|
||||
return ResponseEntity.ok().header("HX-Trigger", "contactsChanged").build();
|
||||
}
|
||||
|
||||
private Contact load(Long id) {
|
||||
return repo.findById(id).orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
/** What the browser posts. A plain getter/setter bean: th:field reads properties through getters
|
||||
* and this is the shape the Thymeleaf-Spring binding documentation shows. (Whether a record
|
||||
* would also work was not tested here.) */
|
||||
public class ContactForm {
|
||||
|
||||
@NotBlank(message = "Name is required")
|
||||
@Size(max = 60, message = "Name must be at most 60 characters")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "Email is required")
|
||||
@Email(message = "Email must look like name@host")
|
||||
private String email;
|
||||
|
||||
@NotBlank(message = "Role is required")
|
||||
private String role;
|
||||
|
||||
public ContactForm() { }
|
||||
|
||||
public ContactForm(String name, String email, String role) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public static ContactForm of(Contact c) {
|
||||
return new ContactForm(c.getName(), c.getEmail(), c.getRole());
|
||||
}
|
||||
|
||||
public String getName() { return name; }
|
||||
public void setName(String name) { this.name = name; }
|
||||
public String getEmail() { return email; }
|
||||
public void setEmail(String email) { this.email = email; }
|
||||
public String getRole() { return role; }
|
||||
public void setRole(String role) { this.role = role; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface ContactRepository extends JpaRepository<Contact, Long> {
|
||||
|
||||
Page<Contact> findByNameContainingIgnoreCaseOrEmailContainingIgnoreCase(
|
||||
String name, String email, Pageable pageable);
|
||||
|
||||
boolean existsByEmailIgnoreCase(String email);
|
||||
|
||||
boolean existsByEmailIgnoreCaseAndIdNot(String email, Long id);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/** The two request headers that decide "fragment or full page". */
|
||||
final class Htmx {
|
||||
|
||||
private Htmx() { }
|
||||
|
||||
/** True for an htmx-issued request that wants a fragment.
|
||||
* htmx also sends HX-Request on a history-cache miss, but then it swaps the response
|
||||
* into the whole body, so that case needs the full page. */
|
||||
static boolean wantsFragment(HttpServletRequest request) {
|
||||
boolean hx = "true".equals(request.getHeader("HX-Request"));
|
||||
boolean historyRestore = "true".equals(request.getHeader("HX-History-Restore-Request"));
|
||||
return hx && !historyRestore;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/** 23 rows, so that a page size of 5 gives five pages and the last one is short. */
|
||||
@Configuration
|
||||
class SeedData {
|
||||
|
||||
@Bean
|
||||
ApplicationRunner seed(ContactRepository repo) {
|
||||
return args -> {
|
||||
if (repo.count() > 0) return;
|
||||
String[] names = {"Aarav Kulkarni", "Bhavna Joshi", "Chinmay Desai", "Divya Nair", "Eshaan Patil",
|
||||
"Farah Sheikh", "Gauri Deshpande", "Harsh Mehta", "Isha Rao", "Jayesh Pawar",
|
||||
"Kavya Menon", "Lakshman Iyer", "Meera Shah", "Neel Bhatt", "Omkar Gokhale",
|
||||
"Pooja Verma", "Qasim Ansari", "Rohan Sawant", "Sneha Kamat", "Tanmay Ghosh",
|
||||
"Uma Pillai", "Vikram Singh", "Yash Thakur"};
|
||||
String[] roles = {"Developer", "Tester", "Architect", "Manager"};
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
String local = names[i].toLowerCase().replace(' ', '.');
|
||||
repo.save(new Contact(names[i], local + "@example.com", roles[i % roles.length]));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ThymeleafHtmxApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ThymeleafHtmxApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ankurm.thymeleafhtmx;
|
||||
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/** The same URL now has two representations. Tell caches, or the back button will show a fragment. */
|
||||
@Component
|
||||
class VaryHtmxFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest req, HttpServletResponse res, FilterChain chain)
|
||||
throws ServletException, IOException {
|
||||
res.addHeader("Vary", "HX-Request");
|
||||
res.addHeader("Vary", "HX-History-Restore-Request");
|
||||
chain.doFilter(req, res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
spring.application.name=thymeleaf-htmx
|
||||
spring.jpa.open-in-view=false
|
||||
@@ -0,0 +1,8 @@
|
||||
body { font-family: system-ui, sans-serif; max-width: 52rem; margin: 0 auto; padding: 1rem; }
|
||||
table { border-collapse: collapse; width: 100%; }
|
||||
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid #ddd; }
|
||||
input.invalid { border: 2px solid #c0392b; }
|
||||
.error { color: #c0392b; display: block; }
|
||||
.pager { display: flex; gap: 1rem; margin-top: .75rem; }
|
||||
.htmx-request { opacity: .6; }
|
||||
tr.htmx-swapping { opacity: 0; transition: opacity .3s ease-out; }
|
||||
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<body>
|
||||
|
||||
<!-- read-only row -->
|
||||
<tr th:fragment="row" th:id="${'contact-' + contact.id}">
|
||||
<td th:text="${contact.name}">Name</td>
|
||||
<td th:text="${contact.email}">email</td>
|
||||
<td th:text="${contact.role}">role</td>
|
||||
<td>
|
||||
<button type="button"
|
||||
th:attr="hx-get=@{/contacts/{id}/edit(id=${contact.id})}"
|
||||
hx-target="closest tr" hx-swap="outerHTML">Edit</button>
|
||||
<button type="button"
|
||||
th:attr="hx-delete=@{/contacts/{id}(id=${contact.id})},hx-confirm='Delete ' + ${contact.name} + '?'"
|
||||
hx-target="closest tr" hx-swap="outerHTML">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- edit row: also what a failed save returns, with errors -->
|
||||
<tr th:fragment="editRow" th:id="${'contact-' + contact.id}" class="editing">
|
||||
<td>
|
||||
<input name="name" th:value="${contactForm.name}" th:classappend="${#fields.hasErrors('contactForm.name')} ? 'invalid'">
|
||||
<small class="error" th:if="${#fields.hasErrors('contactForm.name')}" th:errors="${contactForm.name}">error</small>
|
||||
</td>
|
||||
<td>
|
||||
<input name="email" th:value="${contactForm.email}" th:classappend="${#fields.hasErrors('contactForm.email')} ? 'invalid'">
|
||||
<small class="error" th:if="${#fields.hasErrors('contactForm.email')}" th:errors="${contactForm.email}">error</small>
|
||||
</td>
|
||||
<td>
|
||||
<input name="role" th:value="${contactForm.role}" th:classappend="${#fields.hasErrors('contactForm.role')} ? 'invalid'">
|
||||
<small class="error" th:if="${#fields.hasErrors('contactForm.role')}" th:errors="${contactForm.role}">error</small>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button"
|
||||
th:attr="hx-put=@{/contacts/{id}(id=${contact.id})}"
|
||||
hx-include="closest tr" hx-target="closest tr" hx-swap="outerHTML">Save</button>
|
||||
<button type="button"
|
||||
th:attr="hx-get=@{/contacts/{id}(id=${contact.id})}"
|
||||
hx-target="closest tr" hx-swap="outerHTML">Cancel</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org"
|
||||
th:replace="~{layout/base :: layout(~{::title}, ~{::main})}">
|
||||
<head><title>Contacts</title></head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Contacts</h1>
|
||||
|
||||
<p><a th:href="@{/contacts/new}">New contact</a></p>
|
||||
|
||||
<form th:action="@{/contacts}" method="get" role="search">
|
||||
<input type="search" name="q" th:value="${q}" placeholder="Search name or email"
|
||||
hx-get="/contacts" hx-trigger="input changed delay:300ms, search"
|
||||
hx-target="#contact-table" hx-swap="outerHTML" hx-push-url="true">
|
||||
<noscript><button type="submit">Search</button></noscript>
|
||||
</form>
|
||||
|
||||
<!-- th:fragment "table" is exactly what an htmx request gets back -->
|
||||
<div id="contact-table" th:fragment="table"
|
||||
th:attr="hx-get=${selfUrl}"
|
||||
hx-trigger="contactsChanged from:body" hx-target="this" hx-swap="outerHTML">
|
||||
<table>
|
||||
<thead><tr><th>Name</th><th>Email</th><th>Role</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
<th:block th:each="contact : ${page.content}">
|
||||
<tr th:replace="~{contacts/fragments :: row}"></tr>
|
||||
</th:block>
|
||||
<tr th:if="${page.empty}"><td colspan="4">No contacts match.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<nav class="pager" aria-label="Pages">
|
||||
<a th:if="${prevUrl != null}"
|
||||
th:href="${prevUrl}" th:attr="hx-get=${prevUrl}"
|
||||
hx-target="#contact-table" hx-push-url="true">« Prev</a>
|
||||
<span th:text="${'Page ' + (page.number + 1) + ' of ' + (page.totalPages == 0 ? 1 : page.totalPages) + ' (' + page.totalElements + ' contacts)'}">Page 1 of 1</span>
|
||||
<a th:if="${nextUrl != null}"
|
||||
th:href="${nextUrl}" th:attr="hx-get=${nextUrl}"
|
||||
hx-target="#contact-table" hx-push-url="true">Next »</a>
|
||||
</nav>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org"
|
||||
th:replace="~{layout/base :: layout(~{::title}, ~{::main})}">
|
||||
<head><title>New contact</title></head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>New contact</h1>
|
||||
|
||||
<!-- With JS: hx-post swaps this form for the re-rendered one on a 422.
|
||||
Without JS: the same form posts normally and the full page comes back. -->
|
||||
<form id="contact-form" th:fragment="form" th:action="@{/contacts}" method="post"
|
||||
th:object="${contactForm}" hx-post="/contacts" hx-target="this" hx-swap="outerHTML">
|
||||
<p>
|
||||
<label>Name <input th:field="*{name}" th:errorclass="invalid"></label>
|
||||
<small class="error" th:if="${#fields.hasErrors('name')}" th:errors="*{name}">error</small>
|
||||
</p>
|
||||
<p>
|
||||
<label>Email <input th:field="*{email}" th:errorclass="invalid"></label>
|
||||
<small class="error" th:if="${#fields.hasErrors('email')}" th:errors="*{email}">error</small>
|
||||
</p>
|
||||
<p>
|
||||
<label>Role <input th:field="*{role}" th:errorclass="invalid"></label>
|
||||
<small class="error" th:if="${#fields.hasErrors('role')}" th:errors="*{role}">error</small>
|
||||
</p>
|
||||
<button type="submit">Create</button>
|
||||
<a th:href="@{/contacts}">Cancel</a>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org"
|
||||
th:fragment="layout(title, content)">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title th:replace="${title}">Contacts</title>
|
||||
<!-- htmx 2 swaps 2xx/3xx only. 422 must be allowed to swap, or validation errors never appear. -->
|
||||
<meta name="htmx-config"
|
||||
content='{"responseHandling":[{"code":"204","swap":false},{"code":"[23]..","swap":true},{"code":"422","swap":true,"error":false},{"code":"[45]..","swap":false,"error":true},{"code":"...","swap":false}]}'>
|
||||
<link rel="stylesheet" th:href="@{/css/app.css}">
|
||||
<script th:src="@{/webjars/htmx.org/dist/htmx.min.js}" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header><a th:href="@{/contacts}">Contacts</a></header>
|
||||
<main th:replace="${content}">page content goes here</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user