Spring MVC Tiles ExampleSpring provides integration support with apache tiles framework. So we can simply manage the layout of the Spring MVC application with the help of spring tiles support. Advantage of Tiles support in Spring MVCReusability: We can reuse a single component in multiple pages like header and footer components. Centralized control: We can control the layout of the page by a single template page only. Easy to change the layout: By the help of single template page, we can change the layout of the page anytime. So your website can easily adopt new technologies such as bootstrap, jQuery, etc. Directory StructureLet's see the files of spring tiles example in eclipse. Spring MVC Tiles Example1. Add dependencies to pom.xml file.pom.xml 2. Create the bean classContact.java 3. Create the controller classHelloWorldController.java ContactController.java 4. Provide the entry of controller in the web.xml fileweb.xml 5. Define the bean in the xml filespring-servlet.xml 6. Provide the tiles.xml filetiles.xml 7. Create the requested pageindex.jsp 8. Create the other view componentshello.jsp contact.jsp header.jsp footer.jsp menu.jsp layout.jsp Output: Download Tiles jar fileIf you are not using maven, download tiles jar. Next TopicRemoting in Spring Framework |