Chapter 3. Using Controllers and Views

In this chapter, we will cover the following recipes:

  • Associating a route to a controller method
  • Using a JSP view
  • Passing attributes from a controller to a JSP view
  • Using dynamic route parameters in a controller method
  • Using a common prefix for the routes of a controller
  • Using a page template with Tiles
  • Executing some code before and after controllers using interceptors
  • Building multilingual pages

Introduction

A Spring web application uses a MVC (Model-View-Controller) architecture to process HTTP requests, as shown in the following image:

Introduction

An HTTP request, identified by a route (for example, /user/list), executes a controller ...

Get Spring Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.