O'Reilly logo

Servlet, JSP and Spring MVC: A Tutorial by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18

Annotation-Based Controllers

In Chapter 17, “Introduction to Spring MVC” you built two simple Spring MVC applications using some old style controllers. The controllers were classes that implemented the Controller interface. Spring 2.5 introduced a new way of creating controllers: by using the Controller annotation type.

This chapter discusses annotation-based controllers and the various annotation types that can be beneficial to your applications.

Spring MVC Annotation Types

There are several advantages of using annotation-based controllers. For one, a controller class can handle multiple actions. (By contrast, a controller that implements the Controller interface can only handle one action.) This means, related actions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required