1,拦截器(interceptor)-- 对控制器Controller中的方法,进行前置、后置处理
2,其底层技术是AOP(面向切面编程)
3,拦截器必须实现HandlerInterceptor接口
示例: 配置拦截器applicationContext.xml 执行结果: 拦截器使用场景:权限控制,登录拦截,字符集管理,国际化等。可以做到不修改源代码的情况下实现响应功能。
Copyright © 2023 Powered by MWeb, 湘ICP备2021013552号-1
TOP