zoukankan      html  css  js  c++  java
  • SiteMesh2-标签库

    SiteMesh包括两大标签库。 

    一、Decorator Tags:被用于建立装饰器页面。

    1、<decorator:head/> 

    插入原始页面(被包装页面)的head标签中的内容(不包括head标签本身)。 

    2、<decorator:body/> 

    插入原始页面的<body>标签中的内容(不包括body标签本身)。 

    注释:装饰jsp:<body onload="<decorator:getProperty property="body.onload" />">, 可以在装饰页面body中使用如上语法来获得被装饰页面的事件。 

    3、<decorator:title [default=""]/> 

    插入被装饰页面的title标签中的内容。

    default属性:当没有在被装饰页面找到title中有内容时此值被插入。

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

    插入原始页面的property属性指定的值同名的属性。 

    property:指定那个属性将要被插入。

    default:如果没有发现指定的属性,则插入此值。 

    writeEntireProperty:表示是否将(空格 属性名=“属性值”)整个插入,允许时的值是true或yes或1。

    下面是writeEntireProperty属性的一个例子: 

    装饰器页面:<body bgcolor="White"<decorator:getProperty property="body.onload" writeEntireProperty="true" />>

    被装饰页面:<body onload="document.someform.somefield.focus();">

    经过sitemesh装饰后的效果:<body bgcolor="White" onload="document.someform.somefield.focus();">

    5、<decorator:userPage id=""/> 

    实例化装饰器页面为Page对象,并赋值给一个变量。 

    id属性是必须有的 。

    例子:

    <decorator:usePage id="myPage" />
    <% if ( myPage.getIntProperty("rating") == 10 ) { %>
      <b>10 out of 10!</b>
    <% } %>

    二、Page Tags:被用于从原始内容页面访问装饰器。

    1、<page:applayDecorator name="" [page="" title=""]></page:applayDecorator> 

    应用一个装饰器到指定的内容,这个内容可能是被内联的一个页面,或者是page属性指定的任何一个页面。 

    name:被包含页面要应用的那个装饰器的名字。

    page:被包含的页面。 

    title:覆盖被包含页面的title标签的内容。 

    2、<page:param name=""/> 

    解析一个属性到装饰器,这个属性会覆盖原有页面中的的属性,此标签只能用于<page:applyDecorator>标签内部。

    name:指定要被重写属性的值。

    参考:

    http://flyer2010.iteye.com/blog/1319636

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

  • 相关阅读:
    空格在科技类文章中对阅读体验的影响
    命令行程序增加 GUI 外壳
    贝塞尔曲线控件 for .NET (EN)
    ASCII Art ヾ(≧∇≦*)ゝ
    字符型液晶屏模拟控件(En)
    🃏 用扑克牌编码信息
    <3>Centos系统完整安装python流程
    <自动化测试方案_7>第七章、PC端UI自动化测试
    性能测试方案(-)
    如何自动生成测试用例方案
  • 原文地址:https://www.cnblogs.com/EasonJim/p/7083170.html
Copyright © 2011-2022 走看看