Freemarker - Include Multiple templates inside config file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 14:18:12

问题


How can i include more than one template in Freemarker configuration file using Smooks?

<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">

<params>
  <param name="stream.filter.type">SAX</param>
  <param name="default.serialization.on">false</param>
</params>

<ftl:freemarker applyOnElement="Response">
  <ftl:template>template1.ftl</ftl:template>
  <ftl:template>template2.ftl</ftl:template>
</ftl:freemarker>

This doesnt seem to work. Throws an error at the second template line


回答1:


If you look at example you will see that each ftl:template tag should be inside ftl:freemarker tag. in your case:

<ftl:freemarker applyOnElement="Response">
  <ftl:template>template1.ftl</ftl:template>
</ftl:freemarker>
<ftl:freemarker applyOnElement="Response">
  <ftl:template>template2.ftl</ftl:template>
</ftl:freemarker>


来源:https://stackoverflow.com/questions/49118454/freemarker-include-multiple-templates-inside-config-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!