sitemesh默认使用decorators.xml作为装饰配置文件。本文将对如何使用装饰器进行说明介绍。
decorators.xml顶层元素概览如下:
<decorators>
<decorator/>
<excludes/>
</decorators>
decorators的元素说明:
decorators:装饰器的顶层元素,包括如下
属性
defaultdir:装饰器文件默认存放的目录
子元素
1.decorator
属性:
name:装饰器的名称
page:装饰文件的名称
<parttern/>:需要使用装饰器的访问地址,可以配置多个。
2.excludes
属性:
<parttern/>:不需要使用装饰器的访问地址,可以配置多个。
如下例,包含一个完整的配置元素:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE decorators PUBLIC "-//OpenSymphony//SiteMesh 1.5 Decorators//EN" "http://www.opensymphony.com/sitemesh/dtd/sitemesh_1_5_decorators.dtd">
<decorators defaultdir="/layout">
<decorator name="test1" page="standard_1.ftl">
<pattern>/test1/*</pattern>
</decorator>
<decorator name="test2" page=" standard_2.ftl">
<pattern>/test2/*</pattern>
</decorator>
<excludes>
<pattern>/test1/demo1.jsp</pattern>
</excludes>
</decorators>
说明:装饰器文件存放的目录为”/layout”,
访问地址”/test1/*”所使用的装饰页面为/layout/ standard_1.ftl.
访问地址”/test2/*”所使用的装饰页面为/layout/ standard_2.ftl.
访问地址” /test1/demo1.jsp”,不使用装饰器。
分享到:
相关推荐
201.2.0/middlegenide_1.2.0.zip/download?use_mirror=nchc 下载文件:middlegenide_1.2.0.zip (7)Sitemesh: 本书使用版本:2.2 官方网站:http://www.opensymphony.com/sitemesh/index.html 下载页面:...
SiteMesh (http://www.opensymphony.com/sitemesh/). XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).
SiteMesh (http://www.opensymphony.com/sitemesh/). XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).
SiteMesh (http://www.opensymphony.com/sitemesh/). XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).
SiteMesh (http://www.opensymphony.com/sitemesh/). XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).
4.在WebContent/WEB-INF目录下建sitemesh.xml文件,内容如下: <sitemesh> <property name="decorators-file" value="/WEB-INF/decorators.xml" /> ${decorators-file}" /> class=...
如果需要自定义装饰器映射器,需要在WEB-INF目录下创建一个sitemesh.xml文件(通常从发布包中拷贝过来更改相应部分)。这一步骤是可选的,通常缺省的配置就能够满足要求。 定义装饰器文件 缺省情况下,sitemesh...
sitemesh-3.0-alpha-2.jar
struts2-sitemesh-plugin-2.1.8.1.jar
struts2-sitemesh-plugin-2.2.1.1.jarstruts2
sitemesh3-demo 配置说明参见http://blog.csdn.net/thc1987/article/details/6913416
NULL 博文链接:https://javawxl.iteye.com/blog/2323096
在struts2中使用result里type="stream"的结果类型时,可以实现文件的下载管理,使用时也是比较顺畅,但是当在“下载提示窗口”中点击“取消按钮”时,总是报出“java.lang.IllegalStateException”异常,异常内容...
sitemesh教程
springmvc + mybatis + sitemesh3 超简洁例子 整合springmvc mybatis 方法请看: http://blog.csdn.net/kokoyuo/article/details/52808510
struts2-sitemesh-plugin-2.0.8.jar
SiteMesh教程及SiteMesh官方文档翻译.docx
sitemesh.jar包 sitemesh.jar 包sitemesh.jar 包sitemesh.jar包
NULL 博文链接:https://takeme.iteye.com/blog/1716488
sitemesh 装饰页面技术.