Posts

Showing posts from October, 2013

Configuring Apache Tiles to Avoid Caching During Development

When you want to use Apache Tiles, you will find that your tiles are cached and are not refershed when you reload the page in web browser.

This is a non-issue in production environment because once your webapp is deployed in production you never change your Apache Tiles templates and pages. However, in a development environment this is cumbersome since you will have to redeploy your webapp each time you make a change in your templates.

I faced a similar problem recently and the I found out the I could use the 'useMutableTilesContainer' property in TilesConfigurer class and the 'cache' property in TilesViewResolver class.

You configuration should look something like this:

   <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
          <property name="definitions">
             <list>
                <value>/WEB-INF/path-to-your/tiles-definition.xml</value>
             &…