A step-by-step guide to implementing HTML form handling with Thymeleaf and Spring Boot using the GET-POST-REDIRECT pattern. Covers creating a User entity, repository, service layer, and a dedicated form data object (CreateUserFormData) with Bean Validation annotations. Explains why a mutable form data class is needed separately from immutable domain parameter objects, how to wire up Thymeleaf templates with th:object and th:field for two-way binding, and how to handle validation errors by returning the form view with BindingResult.
Table of contents
Web controllerSort: