Spring Web
Exercise: Todo MVC Application
-
Clone the GitLab repository Todo and copy the REST service.
-
Add the Thymeleaf starter
spring-boot-starter-thymeleaf as Maven dependency.
-
Implement the following Thymeleaf templates:
todo-list.html displays all todos with buttons to edit, complete and delete them, and a button to add a new todo
todo-form.html displays a form to enter the data of a todo and a save button
-
Convert the REST controller
TodoController into an MVC controller that supports the following requests:
GET / gets all todos and displays them
GET /create creates a todo and displays a form to enter its data
POST /save saves a todo
GET /edit/{id} finds a todo and displays a form to update its data
GET /complete/{id} finds a todo and marks it as completed
POST /delete/{id} deletes a todo
-
Create the message bundle
messages and use it to localize the texts in the templates.
Solution