zoukankan      html  css  js  c++  java
  • springMvc 拦截器

    <mvc:interceptors>
            <mvc:interceptor>
                <mvc:mapping path="/**"/>
                <!-- 使用bean定义一个Interceptor,直接定义在mvc:interceptors根下面的Interceptor将拦截所有的请求 -->
                <mvc:exclude-mapping path="/admin/index" />
                <bean class=" com.emark.filter.AuthIntercepter" />
            </mvc:interceptor>
            <!-- <mvc:interceptor> <mvc:mapping path="/test/number.do" /> 定义在mvc:interceptor下面的表示是对特定的请求才进行拦截的 
                <bean class="com.host.app.web.interceptor.LoginInterceptor" /> </mvc:interceptor> -->
    </mvc:interceptors>

    如果有 

    mvc:exclude-mapping 请不要写在最外面。。另外 bean class 要写在mvc interceptor 底部,
    此外头文件要加入以下几句:
    xmlns:mvc="http://www.springframework.org/schema/mvc"

    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  • 相关阅读:
    继承
    对象和封装
    类的无参、带参方法
    类和对象
    数组
    循环结构
    选择结构
    变量、数据类型和运算符
    快捷键
    MyEclipse与JDK的配置
  • 原文地址:https://www.cnblogs.com/whm-blog/p/7054073.html
Copyright © 2011-2022 走看看