I am working on the release of WW-4145 in Apache Struts 2 to extend the Struts tags written with FreeMarker. The problem is how to resolve the path after MultiTemplateLoader has already resolved the path. Or, in other words, if the proposed solution is effective?
<#macro includeThemeTemplate templateName> <#list parameters.themeHierarchy as theme> <#attempt> <#include "/${parameters.templateDir}/${theme}/${templateName}" /> <#break/> <#recover> </#attempt> </#list> <#-- Cause an exception intentionally which will have the top most theme --> <#include "/${parameters.templateDir}/${parameters.themeHierarchy[0]}/${templateName}" /> </#macro>
and use in tag:
<@includeThemeTemplate "controlheader.ftl"/> <#include "/${parameters.templateDir}/simple/checkboxlist.ftl" /> <@includeThemeTemplate "controlfooter.ftl"/>
source share