CHAPTER 5

image

Working with Collections and Custom Types

You need to start adding some useful data and some special types to your Spring application. In this chapter, you will learn how to interact with data using collections within the Spring Framework.

So far, you have declared several beans that hold your type of documents, but there should be a better way to do that. I know that you are thinking of some kind of database or some other local storage or even a flat file, but let’s see how Spring can help you to define your types in a different way, by using them as a collection.

List, Map, and Properties

First, let’s modify the Java classes so you ...

Get Introducing Spring Framework: A Primer now with O’Reilly online learning.

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