Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This chapter showed how annotation-driven development can save you the effort of maintaining the application configuration in separate configuration files. You saw how various Spring features can be accessed using annotations to simplify portlet development. For instance, the classpath-scanning feature can autoregister Spring components, JSR 303’s @Valid annotation can validate objects, and other annotations can map portlet requests to handlers, store model attributes in the handler’s conversational session, autowire objects by type or by name, and so on. The example Book Catalog portlet showed how these features can be combined together to build a multipage portlet. We also looked at how Spring’s TestContext framework simplifies performing unit and integration testing of controllers.
In the next chapter, we’ll look at how Spring simplifies interacting with a database.