sitemesh使用

1.使用sitemesh要在web.xml中加一下几行:

<!-- sitmesh 网页布局框架 -->
<filter>
  <filter-name>sitemesh</filter-name>
  <filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>sitemesh</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>

2.在WEB-INF下加个配置文件sitemesh3.xml,内容:

<sitemesh>
  <!-- 指明满足“/*”的页面,将被“/WEB-INF/views/decorators/decorator.html”所装饰 -->
  <mapping path="/*" decorator="/WEB-INF/views/decorators/decorator.html" />
  <!-- 指明满足“/exclude.jsp*”的页面,将被排除,不被装饰 -->
  <mapping path="/exclude.jsp*" exclue="true" />

</sitemesh>

posted @ 2015-12-27 23:02  网上幽灵  阅读(180)  评论(0编辑  收藏  举报