HomeApache Page 4 - A Closer Look at Simple Components in Apache Tapestry
How to disable caching - Apache
In the previous article, we took a look at some of the components that are used most often in Tapestry applications, and learned some important concepts related to them. At the end, we found that we needed three components for our example application. In this article, we will configure those components. We will also learn how to disable caching.
Tapestry strives to be as efficient as possible, so it caches page templates and specifications in order not to reload them every time when they are needed. This is a very useful behavior in a production application; however, during development it can become annoying, as we might not immediately see the changes we have just made to the page.
Thankfully, there is a way to ask Tapestry not to cache any pages in our development environment.
In NetBeans, click on the Tools menu and then choose Server Manager. In the Server Manager dialog, choose the Platform tab and then enter into the VM Options text box the following option:
-Dorg.apache.tapestry.disable-caching=true
The result should look like this:
Close the dialog, and that’s it. If however Tomcat was running when you applied the setting, you will need to restart Tomcat.
To do this, click on the Runtime tab on the left side of NetBeans IDE and expand the Servers node to see the Bundled Tomcat node:
Right click on the Bundled Tomcat node and choose Restart. As simple as that.
What comes next
In the next part of this tutorial I will explain in more detail how properties of the page class can be defined in Tapestry and when one way is more preferable than the other.
Next we are going to have a more detailed look at the listener methods as there are three ways to write them.
It might also be useful for the future to get familiar with the two ways of submitting the form.
Finally, we shall complete the GuessTheWord project and become familiar along the way with If, Else and PageLink components.