javaEEday11-tlias管理系统-拦截器拦截路径和拦截执行流程!!!
This commit is contained in:
@@ -16,6 +16,6 @@ public class Webconfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(logincheckInterceptor).addPathPatterns("/**");//拦截所有资源
|
||||
registry.addInterceptor(logincheckInterceptor).addPathPatterns("/**").excludePathPatterns("/login");//拦截所有资源
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.inmind.filter;
|
||||
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.annotation.WebFilter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
//@WebFilter(urlPatterns = "/*")//标识为过滤器组件,拦截所有请求
|
||||
@WebFilter(urlPatterns = "/*")//标识为过滤器组件,拦截所有请求
|
||||
public class DemoFilter implements Filter {
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
Reference in New Issue
Block a user