sitemesh的标签

来源:互联网 发布:童虎和撒加 知乎 编辑:程序博客网 时间:2024/04/30 04:48

参考:http://www.opensymphony.com/sitemesh/tags.html

 

SiteMesh有两个标签库分别为sitemesh-decorator.tld、sitemesh-page.tld

<decorator:head />
插入原始页面(被包装页面)的head标签中的内容(不包括head标签本身)。
<decorator:body />

插入原始页面(被包装页面)的body标签中的内容。

<decorator:title [ default="..." ] />

插入原始页面(被包装页面)的title标签中的内容,还可以添加一个缺省值。

<decorator:getProperty property="..." [ default="..." ] [ writeEntireProperty="..." ]/>

在标签处插入原始页面(被包装页面)的原有的标签的属性中的内容,还可以添加一个缺省值。

sitemesh文档中的例子很好理解:
The decorator: <body bgcolor="white"<decorator:getProperty property="body.onload" writeEntireProperty="true" />>
The undecorated page: <body onload="document.someform.somefield.focus();">
The decorated page: <body bgcolor="white" onload="document.someform.somefield.focus();">

注意,writeEntireProperty="true"表示插入为"属性=值"并会在插入内容前加入一个空格。

 

 

原创粉丝点击