关于HandlerInterceptorAdapter和WebMvcConfigurerAdapter过时

修改成这样

@Configuration
public class HeaderTokenInterceptor implements WebMvcConfigurer {

    @Autowired
    SecurityInterceptor securityInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration adminInterceptor = registry.addInterceptor(securityInterceptor);
        adminInterceptor.excludePathPatterns("/admin/login")
                .excludePathPatterns("/adminlogs/log")
                .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**");
        //拦截所有路径
        adminInterceptor.addPathPatterns("/admin/**");
    }

}
@Configuration
public class SecurityInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
}

Original: https://www.cnblogs.com/Slience-me/p/16341836.html
Author: Slience_me
Title: 关于HandlerInterceptorAdapter和WebMvcConfigurerAdapter过时

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/585857/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • docker与kubectl 命令自动补齐

    安装自动补齐需要依赖工具 docker命令补齐: 执行下列命令 kubectl命令补齐: Original: https://www.cnblogs.com/qianyuliang…

    Linux 2023年6月8日
    080
  • 记一次PowerShell配合Metersploit的艰难提权

    0x01 环境准备 kali(模拟公网攻击机) Windows2008(靶机,装有360、火绒、安全狗、D盾) Powersploit(PowerShell攻击框架) https:…

    Linux 2023年5月28日
    087
  • 【原创】Linux虚拟化KVM-Qemu分析(六)之中断虚拟化

    背景 Read the fucking source code! –By 鲁迅 A picture is worth a thousand words. –…

    Linux 2023年6月8日
    0116
  • 浅谈缓存击穿、缓存穿透、缓存雪崩、缓存预热、缓存降级

    对于缓存,大家肯定都不陌生,不管是前端还是服务端开发,缓存几乎都是必不可少的优化方式之一。在实际生产环境中,缓存的使用规范也是一直备受重视的,如果使用的不好,很容易就遇到缓存击穿、…

    Linux 2023年6月14日
    0107
  • SpringBoot入门-Redis(六)

    package com.vast; import com.vast.dao.AccountRepository; import com.vast.dao.IAccountMybat…

    Linux 2023年5月28日
    072
  • ArchLinux安装-2022-01-12

    这篇教程,是我基于B站up住theCW的视频教程整理的,其中添加了一些我在安装n次之后的经验(虽然失败过几次,但我现在安装不会再出差错,所以请放心的看此教程) 当然,我认为theC…

    Linux 2023年6月13日
    0103
  • 防止shell script多次运行

    防止shell script多次运行 一个思路是在script初期检测系统中是否存在同名进程。 if [ ps -ef | grep "test.sh" | g…

    Linux 2023年5月28日
    086
  • algorithm 头文件参考

    定义执行算法的 C++ 标准库容器模板函数。 该 <algorithm></algorithm> 库还使用该 #include <initialize…

    Linux 2023年6月7日
    0121
  • 剑指offer计划21( 位运算简单)—java

    1.1、题目1 剑指 Offer 15. 二进制中1的个数 1.2、解法 通过判断每一位的与来识别1的数量。 1.3、代码 public class Solution { // y…

    Linux 2023年6月11日
    0144
  • iptables快速入门

    iptables简介 在生产实践过程中,为了保证生产安全,通常需要进行数据加密,例如通过网络层面上将应用隔离成内网和公网应用,内网再分成生产、测试、开发、DMZ等区域,然后进行不同…

    Linux 2023年6月6日
    0103
  • RNN循环神经网络

    1.为什么还会有RNN? CNN(卷积神经网络)我们会发现, 他们的输出都是只考虑前一个输入的影响而不考虑其它时刻输入的影响, 比如简单的猫,狗,手写数字等单个物体的识别具有较好的…

    Linux 2023年6月6日
    0142
  • Java分布式集群,使用synchronized和Redis保证Job的原子性

    1.使用synchronized保证并发时,同时只会有一个请求执行该代码段; 2.在执行前先设置并获取Reids标记,先设置然后获取确保是否已经执行;SetOption.SET_I…

    Linux 2023年5月28日
    0108
  • 在 Windows 搭建 SVN 服务

    以下内容为本人的学习笔记,如需要转载,请声明原文链接微信公众号「englyf」 https://mp.weixin.qq.com/s/JIKNVuH5FIwEQMnYGxmRiQ …

    Linux 2023年6月6日
    0144
  • 搭建zabbix 4.0

    安装zabbix的依赖包 下载zabbix源码包 数据库导入数据的命令格式:mysql ­u用户名 ­p密码 数据库名称 < 要导入的数据 此时的路径是在databases/…

    Linux 2023年6月8日
    0120
  • SQLI-LABS(Less-6)

    Less-6(GET-Double injection-Double Quotes-String) 打开 Less-6页面,可以看到页面中间有一句 Please input the…

    Linux 2023年6月6日
    094
  • 手把手教你搭建一个SpringBoot工程

    手把手教你搭建一个SpringBoot工程 首先进入Spring官网,下载Demo工程 像这样设置好 点击下载 将工程导入Idea并打开 在 application.propert…

    Linux 2023年6月14日
    0128
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球