Enough of introduction; let's dive into Apache Tiles by defining a common layout for our web application and let the pages extend the layout:
Open
pom.xml
; you will findpom.xml
under the project root directory.You will be able to see some bottom tabs under
pom.xml
; select the Dependencies tab and click on the Add button of the Dependencies section.A Select Dependency window will appear; enter Group Id as
org.apache.tiles
, Artifact Id astiles-extras
, and Version as3.0.3
. Then, select Scope as compile, click on the OK button, and savepom.xml
.Similarly, add one more dependency with Group Id as
org.slf4j
, Artifact Id asslf4j-api
, and Version as1.7.5
. Then, select Scope as compile, click on the OK button, and savepom.xml
.Now create a directory structure,
tiles/definitions/
, under the directorysrc/main/webapp/WEB-INF/
; then, create an XML file calledtile-definition.xml
, add the following content into it, and save it. In the following...