Static Server-Side Rendering - I
Explore how to expand team editing forms using static server-side rendering with Thymeleaf. Learn to model player data with form objects, apply validation annotations, and update HTML templates. Understand how to integrate these forms with Spring Boot controllers and prepare your application for dynamic team management.
We'll cover the following...
Expanding the form
The form that edits a Team has the backing form objects CreateTeamFormData and EditTeamFormData. To allow for adding and editing of the users on that team, we’ll need to expand those objects.
Single player data
We’ll start by creating TeamPlayerFormData which contains the information of a single player and their position on the team:
We can now use this in CreateTeamFormData to model the information of the players in the HTML
form:
-
Use an array of
TeamPlayerFormDataobjects to store the information that will be edited in the HTML form. The ...