How to integrate Tiles in Spring Application
We
are going to see how to integrate tiles in spring application
1.
The
folder structure is as follows
2.
Spring-Servlet.xml
Configure your spring application in this
spring-servlet.xml
Add view resolver and tiles configure as follows and
define the path where the tiles.xml is present
3.
Tiles.xml
In the tiles.xml define your header, footer, menu as
base. definition and extend this base definition in every body definition as
follows.
4.
Libraries
required to run the project
5.
Header.jsp
6.
Footer.jsp
7.
Menu.jsp
8.
Hello.jsp
9.
Index.jsp
10. Home.java
Src/com.jad.springintegration/home.java
Define a controller for the action defined in the index.jsp
to render our body page(hello.jsp),the controller should be as follows.
11. Output:
Initially you will see this screen on clicking the link you can see your tiles
page.
No comments:
Post a Comment