同一装饰器配置文件中的多个页面
我将装饰器模板与 sitemesh 结合使用,并有一个 decorators.xml
文件,例如:
<decorators defaultdir="/WEB-INF/decorators">
<excludes>
<pattern>/styles/*</pattern>
<pattern>/scripts/*</pattern>
<pattern>/images/*</pattern>
<pattern>/index.html</pattern>
</excludes>
<decorator name="layout" page="layout.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
我想向此文件添加更多装饰器。我必须将它们的模式分开。
有没有办法不用为所有页面一一添加图案呢?
I use decorator template with sitemesh and have a decorators.xml
file like:
<decorators defaultdir="/WEB-INF/decorators">
<excludes>
<pattern>/styles/*</pattern>
<pattern>/scripts/*</pattern>
<pattern>/images/*</pattern>
<pattern>/index.html</pattern>
</excludes>
<decorator name="layout" page="layout.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
I want to add more decorators to this file. I must separate their patterns.
Is there any way without adding patterns for all pages one by one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了这个问题的解决方案。
此 xml 自上而下过滤页面。所以如果你只想为一个页面编写一个装饰器,你必须这样写;
所以 layout.jsp 不适用于 page1,它在第一个装饰器中被过滤。
i found the solution for this problem.
this xml filters pages top-down. so if you want to write a decorator for only a page, you must write;
so layout.jsp does not work for page1, it is filtered at first decorator.