Note 30 View Resolution - TilesViewResolver

Apache Tiles, which define a common page layout that applies to all pages. Spring MVC provides support for Apache Tiles in the form of a view resolver capable of resolving logical view names into tile definitions. 

1. Configure the Tiles view resolver

In order to use Tiles with Spring, several beans need to be configured. A TilesConfigurer bean that will be responsible for locating and loading Tile definitions and coordinating the generation of Tiles. In addition to this, the TilesViewResolver bean is required to resolve logical view names to Tile definitions. These two components have two forms: there are two components for Apache Tiles 2 and Apache Tiles 3 respectively.

The most obvious difference between these two sets of Tiles components is the package name. The TilesConfigurer/TilesViewResolver for Apache Tiles 2 is in the org.springframework.web.servlet.view.tiles2 package, while the components for Tiles 3 are in the org.springframework.web.servlet.view.tiles3 package.

Use Tiles 3. 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324986836&siteId=291194637