8 Implementing web apps with Spring Boot and Spring MVC
This chapter covers
- Using a template engine to implement dynamic views
- Sending data from client to server through HTTP requests
- Using GET and POST HTTP methods for your HTTP requests
We made progress in understanding how to use Spring to write web apps. We’ve discussed web apps’ components, the dependencies a web app needs, and the Spring MVC architecture. We even wrote a first basic web app to prove all these components work together.
Now we’ll take a step further and implement some capabilities you’ll find in any modern web app. Today, we rarely see static pages on websites. You probably think, “There has to be a way to decide what content to add to the pages before delivering the HTTP response back to the browser.” There are ways you can do this!
We’ll implement dynamic views using template engines. A template engine is a dependency that allows you to easily get and display variable data that the controller sends. We’ll demonstrate how the template engine works in an example after reviewing the Spring MVC flow.