<action name="rsslatest" class="xx.action.rss.RssLatestVideosAction">
<result name="success" type="freemarker">
<param name="location">/cn/rss/rsslatest.ftl</param>
<param name="contentType">application/xml</param>
</result>
</action>
如果不这样写webwork默认返回html
官方文档上列举了如下几个可以使用的 param
<result name="success" type="freemarker">
<param name="location">/cn/rss/rsslatest.ftl</param>
<param name="contentType">application/xml</param>
</result>
</action>
如果不这样写webwork默认返回html
官方文档上列举了如下几个可以使用的 param
- location (default) - the location of the template to process.
parse - true by default. If set to false, the location param will not be parsed for Ognl expressions.
contentType - defaults to "text/html" unless specified.
本文介绍 WebWork 中 RSS 最新视频配置方法,详细解析了如何通过指定模板位置与内容类型来实现RSS输出。默认情况下,WebWork 返回 HTML 格式,但可通过配置返回 XML 格式的 RSS 订阅源。

204

被折叠的 条评论
为什么被折叠?



