开发者

siteMeshInterceptor except a page

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜