• 2024-03-04黑马程序员JavaWeb学习笔记-拦截器
    拦截器--Interceptor--快速入门@Component注解交给ioc容器管理--注册配置拦截器@Configuration注解用来标识当前是Spring当中的一个配置类//Interceptor拦截所有("/**")//Filter拦截所有("/*")//WebConfig需要在包下新建一个config包与controller同级//.excl
  • 2023-11-03springboot配置静态资源访问
    重写WebMvcConfigurer中的addResourceHandles1.配置静态资源地址 2.重写 完整代码@ConfigurationpublicclassInterceptorConfigimplementsWebMvcConfigurer{@Value("${file.path}")privateStringpath;//D:/ndedu/image/@Value("${file.stat
  • 2023-02-24拦截器
    拦截器机制前端发送请求,通过控制器完成定义好的方法,在将数据渲染到前端。拦截器分为三个方法分别是preHandle、postHandle、afterCompletion,我们可以分别利用这三个方法在
  • 2023-01-08springboot加入拦截器后swagger无法访问
    由于需要对用户权限进行认证,判断登录与否,然后设置了全局拦截器,然后测接口的额时候swagger也被拦截了(QAQ)拦截器不配置拦截路径时可以访问,配置后出现以下情况两种
  • 2022-12-28WebMvcConfigurer 配置swagger的权限
      importorg.springframework.context.annotation.Bean;importorg.springframework.context.annotation.Configuration;importorg.springframework.web.servlet.