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>
             </list>
          </property>
          <property name="useMutableTilesContainer" value="true" />
       </bean>



<bean id="viewResolver" class="org.springframework.web.servlet.view.tiles3.TilesViewResolver">
      <property name="viewClass">
         <value>
            org.springframework.web.servlet.view.tiles3.TilesView
         </value>
      </property>
      <property name="cache" value="false" />
   </bean>


I hope that this helps somebody facing caching problem in Apache Tiles during development.

Basically you have to set 'useMutableTilesContainer' to true and the 'cache' property to false.

The 'useMutableTilesContainer' property is in TilesConfigurer class and the 'cache' property is in TilesViewResolver class.

Happy Coding!

Comments

  1. We read your blog , share most useful information in blog . Web Design

    ReplyDelete
  2. I am very thankful for the author who shared the informative blog. This helps the first home buyers in a better way to choose the appropriate location.
    Builders in Chennai
    Properties in Chennai

    ReplyDelete
  3. I am thankful to this blog giving unique and helpful knowledge about this topic. Software Outsourcing Services

    ReplyDelete
  4. These are really amazing and valuable websites you have share with us. Thanks for the informative post.
    WordPress development company in Chennai

    ReplyDelete
  5. Nah dengan memperhatikan beberapa hal diatas, maka ini akan menjadi salah satu cara dan jalan terbaik untuk anda bisa mendapatkan keuntungan
    asikqq
    http://dewaqqq.club/
    http://sumoqq.today/
    interqq
    pionpoker
    bandar ceme
    freebet tanpa deposit
    paito warna terlengkap
    syair sgp

    ReplyDelete
  6. Great blog ! I am impressed with suggestions of author. School ERP

    ReplyDelete

Post a Comment

Be relevant. Spammers will be banned.

Popular posts from this blog

Installing ColdFusion on IIS 7 + Configure IIS for ColdFusion in Windows Vista and Windows Server 2008

ColdFusion Manual Configuration & Issues with TCP ports 51011, 51010 and 51800 on IIS and Apache