Could开发者_运维技巧 you please tell me what is the freemarker equivalent tag of < tiles:insertAttribute name="contentName" /> ? I have tried out with <@tiles.insertAttribute name="contentname" /> and it throws error(as freemarker.core.InvalidReferenceException: Expression tiles is undefined).
You have to tell FreeMarker what tiles
is, e.g. by retrieving the Tiles taglib from the JspTaglibs
hash. You probably want to read the section about FreeMarker, servlets and taglibs from the FreeMarker manual.
from this example: http://alvinalexander.com/java/jwarehouse/struts/src/apps/showcase/src/main/webapp/tiles/layout.ftl.shtml
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
...
<@tiles.insertAttribute name="header" />
精彩评论