【问题标题】:Sitemesh 3. Output all body tag attributes to the layoutSitemesh 3. 输出所有body标签属性到布局
【发布时间】:2012-07-30 04:11:22
【问题描述】:

我有一个页面:

<body class="auth_loginForm" controller="auth" action="loginForm" >

以及带有主体的站点网格布局:

 <body iamalayout="true" >
    <sitemesh:write property='body'/>
 </body>

有没有办法让body的属性出现在最后一页?

这就是最终的body标签应该是这样的:

<body iamalayout="true" class="auth_loginForm" controller="auth" action="loginForm" >

【问题讨论】:

    标签: spring jakarta-ee spring-mvc sitemesh


    【解决方案1】:

    尝试像这样设置你的布局主体标签:

    <body iamalayout="true" <decorator:getProperty property="body.class" /> <decorator:getProperty property="body.controller" /> <decorator:getProperty property="body.action" /> >
    

    或者如果它不能正常工作,请尝试为每个装饰器附加 writeEntireProperty="true":getProperty 标记,例如

     <decorator:getProperty property="body.class" writeEntireProperty="true" />
    

    希望对你有帮助。

    http://wiki.sitemesh.org/wiki/display/sitemesh/Tag+References

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-13
      • 1970-01-01
      • 2011-11-23
      • 2012-10-15
      相关资源
      最近更新 更多