? I have tried out with <@tiles.insertAttribute name=\"contentnam" />
开发者

Freemarker equivalent of <tiles:insertAttribute name="contentName" />

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" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜