img
.
View Templating with Apache Tiles
For view templating using JSP technology, Apache Tiles (http://tiles.apache.org) is the most popular
framework in use. Spring MVC tightly integrates with Tiles.
In order to use Tiles, we need to add the required dependencies in the project, as shown in Table
17-4.
Table 17-4. Maven Dependencies for Apache Tiles
Group ID
Artifact ID
Version
Description
2.2.2
The core library for Apache Tiles
org.apache.tiles
tiles-core
2.2.2
Apache Tiles support for JSP view files
org.apache.tiles
tiles-jsp
In the following sections, we will discuss how to implement page templates, including page layout
design, definition, and implementation of the components within the layout.
Template Layout Design
First we need to define how many templates are required in our application and, for each different
template, what the layout looks like.
In the contact sample in this chapter, we require only one template. The layout is rather trivial, as
shown in Figure 17-9.
Figure 17-9. Page template with layout components
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home