If you are using struts 2.0.9 or earlier, then you will have to copy the template directory out of the struts2-core jar file into your web-app. (Off the top of my head, I can't remember if you copy it to context-root, context-root/WEB-INF, context-root/WEB-INF/classes, but I'm sure that's in the docs or online somewhere).
If you are using 2.0.10 or higher, then just set the mentioned value to true... You can do that by putting this in your struts.xml file - <constant name="struts.freemarker.templatesCache" value="true" /> -Wes On Mon, Feb 15, 2010 at 2:33 PM, Hoying, Ken <ken_hoy...@premierinc.com> wrote: > I am finding the text regarding the enablement of Freemarker template caching > in the performance tuning document > (http://struts.apache.org/2.1.8.1/docs/performance-tuning.html) to be a bit > confusing. > > The document states: > <start clip> > As of Struts 2.0.10, setting the property struts.freemarker.templatesCache > to true will enable the Struts internal caching of Freemarker templates. This > property is set to false by default. > > In Struts versions prior to 2.0.10, you had to copy the /template directory > from the Struts 2 jar in your WEB_APP root to utilize Freemarker's built in > chaching mechanism in order to achieve similar results. > > The built in Freemarker caching mechanism fails to properly cache templates > when they are retrieved from the classpath. Copying them to the WEB_APP root > allows Freemarker to cache them correctly. Freemarker looks at the last > modified time of the template to determine if it needs to reload the > templates. Resources retrieved from the classpath have no last modified time, > so Freemarker will reload them on every request. > <end clip> > > I am confused. Do I or don't I need to copy the Freemarker templates to my > WEBAPP to take advantage of the caching? Do I copy them to > WEBAPP\template\.. or to WEBAPP\struts\template like with the static content? > > Thanks, > Ken > > > > ----------------------------------------- > ***Note:The information contained in this message may be privileged > and confidential and protected from disclosure. If the reader of > this message is not the intended recipient, or an employee or agent > responsible for delivering this message to the intended recipient, > you are hereby notified that any dissemination, distribution or > copying of this communication is strictly prohibited. If you have > received this communication in error, please notify the Sender > immediately by replying to the message and deleting it from your > computer. Thank you. Premier Inc. -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org