Chapter 6. Rendering web views

This chapter covers

  • Rendering model data as HTML
  • Using JSP views
  • Defining view layout with tiles
  • Working with Thymeleaf views

In the previous chapter, we primarily focused on writing the controllers that handle web requests. You also created some simple views to render the model data produced by those controllers, but we didn’t spend too much time discussing the views or what happens between the time a controller finishes handling a request and the time the results are displayed in the user’s web browser. That’s the topic of this chapter.

6.1. Understanding view resolution

None of the methods in the controllers you wrote in chapter 5 directly produce the HTML that is rendered in the browser. Instead, they ...

Get Spring in Action, 4th Edition: Covers Spring 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.