Struts2 template加载 默认是ftl的道理
一般情况下,如果我们需要修改struts标签的表现,方法就是:
- 指定使用的theme
- 将struts-core.jar中的theme拷贝出来,解压到classpath下目录名应该为template/${theme}
- 修改theme中对应的ftl文件
为什么默认使用的是ftl,在何处定义的或者配置的呢?
Alternative Template Engines
The framework provides for template rendering engines other than FreeMarker. (Though, there is rarely a need to use another system!)
Don’t try this at home!
Alternative template engines are best left to advanced users with special needs!
The framework supports three template engines, which can be controlled by the struts.ui.templateSuffix in struts.properties.
ftl (default) | FreeMarker-based template engine |
---|---|
vm | Velocity-based template engine |
jsp | JSP-based template engine |
译:
可选模板的解析引擎
这个框架提供了除freemarker之外的其他解析引擎.(即使很少有需要需要这样做!)
不要随意尝试!
可选的引擎仅供很熟许的人和很特别的需求使用!
Struts框架提供了三个模板引擎,可以通过strtus.properties中的struts.ui.templateSuffix进行控制。
NOTE: 附上官方链接
在我自己寻找的过程中,并非是struts.properties或者struts-default.properties,而是struts-core.jar中org.apache.struts2下的default.properties.