Chapter 3. Control Your Store with Controllers

In Chapter 2, Spring MVC Architecture – Architecting Your Web Store, we learned the overall architecture of a Spring MVC application. We didn't go into any of the concepts in detail; our total aim was to understand the overall flow. In this chapter, we are going to have an in-depth look at the controllers in Spring MVC as they have an important role.

This chapter will cover the following concepts:

  • Defining a controller
  • URI template patterns
  • Matrix variables
  • Request parameters

Defining a controller

Controllers are presentation layer components that are responsible for responding to user actions. These actions could be entering a particular URL on the browser, clicking on a link, submitting a form on a web ...

Get Spring MVC Beginner’s Guide 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.