Sitemesh 自定义decorators.xml 文件路径
来源:互联网 发布:js apply的z作用 编辑:程序博客网 时间:2024/06/07 09:02
实现思路: 通过覆盖默认的sitemesh.xml来实现
1. 打开sitemesh的jar文件, 在com.opensymphony.module.sitemesh.factory目录里找到sitemesh-default.xml,
将其复制到项目的任意目录(如/commons/sitemsh/目录), 并将其改名为sitemesh.xml;
2. 在web.xml文件里添加一个容器参数sitemesh.configfile,值为sitemesh.xml的项目路径. 具体如下:
<context-param> <param-name>sitemesh.configfile</param-name> <param-value>/commons/sitemesh/sitemesh.xml</param-value> </context-param>
3.修改sitemesh.xml中属性为decorators-file的value值,根据decorators.xml 文件所在的项目路径来修改(如decorators.xml 位于/commons/sitemesh目录),其余配置保持不变.,具体如下:
<sitemesh> <property name="decorators-file" value="/commons/sitemesh/decorators.xml"/> <excludes file="${decorators-file}"/> <page-parsers> <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/> </page-parsers>
4. 通过以上设置也就完成了自定义decorators.xml 文件路径 的功能.
更多信息请参考sitemesh 源码中的 DefaultFactory.java 文件.
帮助别人,提升自己.
- Sitemesh 自定义decorators.xml 文件路径
- SiteMesh:关于decorators.xml配置文件中路径设置的问题
- sitemesh中的decorators.xml的用法
- sitemesh中的decorators.xml的用法
- Cannot load excludes configuration file "/WEB-INF/decorators.xml" as specified in "sitemesh.xml" or "sitemesh-default.xml"(已解决)
- sitemesh decorators 复合页面Demo
- 使用sitemesh的decorators功能
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml
- decorators.xml的用法
- decorators.xml的用法
- decorators.xml的用法
- 第十一周项目二一——派生类的应用2(派生类不可直接调用基类)
- su与sudo的区别
- VI使用技巧总结
- JNDI (Java Naming and Directory Interface)
- POJ 1088 滑雪(DP+记忆化搜索)
- Sitemesh 自定义decorators.xml 文件路径
- office word 每页头上的这个字怎么删除不掉.?怎么更改里面的字!
- Java OutOfMemory Error引发的JVM参数实测--线程堆栈参数篇
- asp返回上一页
- 阿里巴巴2013笔试最后一题解答
- 用HttpSessionListener与HttpSessionBindingListener实现在线人数统计
- mfc 序列化类(串行化类)的继承和虚函数应用
- 暗时间 笔记
- How I Made Porn 20x More Efficient with Python