Data Models

Extended Models

ExtendedList and ExtendedHash are simple sub-classes of the SimpleList and SimpleHash classes. These provide a small set of convenience keys that reflect properties of the underlying List or Map respectively, such as the size, keysets, and so on. See the JavaDoc for all the details.

ExtendedList has a number of other convenient features. If a TemplateListModel needs to be cached, a SimpleList can make a copy of it. If you're using a SimpleList as a cache, you can also give it a shelf life; its owner (e.g. a servlet) can then ask it, before each request is processed, whether it's gotten stale, and refresh it if necessary.