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

    拦截器interceptors

      1. 基于HandlerMapping,对请求实施拦截,根据业务需求,基于不同的HandlerMapping定义多个拦截器

      2. HandlerInterceptor接口

        preHandle()

        postHandle()

        afterCompletion()

      3. 自定义拦截器

        第一步:写一个类继承HandlerInterceptor

        第二步:重写preHandle()

           postHandle()

           afterCompletion()任意方法

        第三步:配置

          <!-- 配置拦截器 -->

          <mvc:interceptors>

            <mvc:interceptor>

              <!-- 要拦截的url-->

              <mvc:mapping path="/sys/**"></mvc:mapping>

              <bean class="com.ssm.interceptor.SysInterceptor"></bean>

            </mvc:interceptor>

          </mvc:interceptors>

  • 相关阅读:
    Python 字符串
    python 元组用法
    python 字典用法
    环境配置
    桥式整流以及电容作用
    三角序列的正交性
    MDS
    ISOMAP
    randperm
    数据库~Mysql里的Explain说明
  • 原文地址:https://www.cnblogs.com/yang82/p/8453719.html
Copyright © 2011-2022 走看看