With a lot of debugging, I think i have found what's wrong. If you use the default setting,
In method [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager], Struts will create 3 TemplateLoader which is: 1,ClassTemplateLoader, which will load Template from class url 2,WebappTemplateLoader, which will load Template from WebApp folder 3,StrutsClassTemplateLoader, I don't known what different with ClassTemplateLoader The 3 TemplateLoader will be executed in this order, which means, the ClassTemplateLoader get higher priority than WebappTemplateLoader. (See method [findTemplateSource] of class [freemarker.cache.MultiTemplateLoader]) So, if you simply put your template under the WebApp folder, it will not be used, because the ClassTemplateLoader will load the old template from struts2-core-2.2.1.jar. I think it may be a Struts2 bug, because this result is obviously different from the Struts2 document (http://struts.apache.org/2.2.1/docs/template-loading.html) but I am not very sure about it. Before they fix this bug, i suggest you add this setting in your web.xml: <context-param> <param-name>TemplatePath</param-name> <param-value></param-value> </context-param> It will make FreemarkerManager not to create ClassTemplateLoader, so the WebappTemplateLoader will get highest priority. I tested it, and it works in my environment. Or you can set this parameter to: <context-param> <param-name>TemplatePath</param-name> <param-value>class://package</param-value> </context-param> and put your template under the [package]. But i did not test this solution. BTW: The param [templatePath] can start with only "class://" or "file://". Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value "template" means nothing, it will get the same result as setting it to a empty string or anything else. -- View this message in context: http://old.nabble.com/-S2--2.2.1-possible-freemarker-template-bug-tp29462347p30008153.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org