Search code examples
xmlspringtemplatesspring-mvcapache-tiles

Apache Tiles: How to split Template.xml tiles-definition


We have a very large project.

and each developers is working on different part of the UI but require to modify the template.xml.

is there a way split the template.xml using include tag or somehow modular ?


Solution

  • Not sure how you configure Tiles currently (and if your UI is structured), but since you tagged the question with Spring MVC you could simply list all tile definitions in Spring config:

    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
       <property name="definitions">
         <list>
           <value>/WEB-INF/defs/general.xml</value>
           <value>/WEB-INF/defs/widgets.xml</value>
           <value>/WEB-INF/defs/administrator.xml</value>
           <value>/WEB-INF/defs/customer.xml</value>
           <value>/WEB-INF/defs/templates.xml</value>
         </list>
       </property>
     </bean>
    

    (Example copied from the documentation)