siteMesh配置文件的名称及路径问题

小水晶 2009-09-21 12:38:02
就是decorators.xml
有什么地方可以让siteMesh不在web-inf下找这个文件,而且这个文件可以重命名吗?

我的项目中所有的配置文件如sturts.xml,spring.xml都不在web-inf下,可现在用到
siteMesh,我希望把配置文件叫sitemesh.xml,而且不直接放在web-inf下,不如放在
classes\conf里

谢谢
...全文
104 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
imasmallbird 2009-09-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 lcrystal623 的回复:]
sitemesh.xml文件不能改位置吗?唉,看着不舒服
[/Quote]
真的不能,可能设计没往这方面想吧~~
小水晶 2009-09-21
  • 打赏
  • 举报
回复
sitemesh.xml文件不能改位置吗?唉,看着不舒服
imasmallbird 2009-09-21
  • 打赏
  • 举报
回复
明确告诉你,不行~~
配置sitemesh的配置文件有两种方法
一、就是默认建立[web-app]/WEB-INF/decorators.xml
二、你可以在指定decorators.xml这个文件的位置,但是一但你改变了它的位置,
你就必须建立[web-app]/WEB-INF/sitemesh.xml这个文件,里面如下配置:

<sitemesh>
<property name="decorators-file" value="/WEB-INF/decorators.xml" />
<excludes file="${decorators-file}" />

<page-parsers>
<parser content-type="text/html"
class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" />
<parser content-type="text/html;charset=ISO-8859-1"
class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" />
</page-parsers>

<decorator-mappers>
<mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
<param name="config" value="${decorators-file}" />
</mapper>
</decorator-mappers>
</sitemesh>



而这样还是无法满足你在[web-app]/WEB-INF/不建立配置文件的要求
官网配置说明文档

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧