zoukankan      html  css  js  c++  java
  • SpringBoot2 Filter执行两次问题解决

    原因:在请求指定url之外还请求了/favicon.ico 地址 过滤掉问题就解决了

    
    


    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    HttpServletRequest httpServletRequest=(HttpServletRequest) request;
    //favicon 不请求 否则给人执行两次的错觉
    if(!httpServletRequest.getRequestURI().contains("favicon.ico")){
    System.out.println(httpServletRequest.getRequestURI());
    chain.doFilter(request,response);
    }

    }

    }

  • 相关阅读:
    HDU 5444 Elven Postman 二叉排序树
    HDU 5438 Ponds dfs模拟
    Gym
    markdown test
    Gym
    集训回顾
    UVALive
    UVALive
    UVALive
    codeforcres 589 J
  • 原文地址:https://www.cnblogs.com/coderdxj/p/11445303.html
Copyright © 2011-2022 走看看