用Freemarker模板引擎呈现页面视图.另外com.opensymphony.webwork.dispatcher.ServletDispatcherResult的dispatcher结果类型可以和WebWork的FreemarkerServlet一起使用.
由FreemarkerManager类配置模板加载器, 所以模板的位置可以有两种:
- 相对于web根文件夹. 如 /WEB-INF/views/home.ftl
- classpath下的资源. 如 com/company/web/views/home.ftl
参加WebWork Freemarker Support.
参数
- location (默认) - 模板的位置.
- parse - 默认为true. 如果设置为false, location参数不会被当作Ognl表达式解析.
- contentType - 如果不指定默认为"text/html"
例子
<result name="success" type="freemarker">foo.ftl</result>