开发者

siteMeshInterceptor except a page

开发者 https://www.devze.com 2023-02-16 05:32 出处:网络
i use siteMeshInterceptor for my spring mvc project. Is there a way开发者_开发技巧 excluding a page from interception? I want to solve this in dispatcherServlet, not in interceptor code.

i use siteMeshInterceptor for my spring mvc project. Is there a way开发者_开发技巧 excluding a page from interception? I want to solve this in dispatcherServlet, not in interceptor code.

inceptor looks like this in dispatcherServlet;

<property name="interceptors">
<list>
    <ref local="myInterceptor"/>
</list>
</property>

Thanks.


You can define different sitemash decorators for different url patterns.

decorators.xml

<decorators defaultdir="/WEB-INF/sitemesh/decorators">
    <excludes>
        <pattern>/login.html*</pattern>        
    </excludes>

    <decorator name="main" page="main.jsp">
          <pattern>/*</pattern>
    </decorator>    
    <decorator name="main" page="main.jsp">
          <pattern>/help/*</pattern>
    </decorator>        
</decorators>
0

精彩评论

暂无评论...
验证码 换一张
取 消