pageProperty

用途

用布局输出属性内容的装饰页。 当于SiteMesh <decorator:getProperty/>标记。

示例

修饰页面的例子:

<html>
   <head>
        <meta name="layout" content="myLayout" />
        <script src="myscript.js" />
   </head>
   <body onload="alert('hello');">Page to be decorated</body>
</html>
修饰布局的例子:

<html>
   <head>
        <script src="global.js" />
        <g:layoutHead />
   </head>
   <body onload="${pageProperty(name:'body.onload')}"><g:layoutBody /></body>
</html>
结果:

<html>
   <head>
        <script src="global.js" />
        <script src="myscript.js" />
   </head>
   <body onload="alert('hello');">Page to be decorated</body>
</html>

来源

Show Source