Filter(过滤器)与Interceptor(拦截器)的区别,通过拦截器实现登录校验功能
1.接口规范不同:过滤器需要实现Filter接口,而拦截器需要实现Handlercepetor接口。
2.拦截范围不同:过滤器Filter会拦截所有的资源,而Interceptor只会拦截Spring环境中的资源。
1.接口规范不同:过滤器需要实现Filter接口,而拦截器需要实现Handlercepetor接口。
2.拦截范围不同:过滤器Filter会拦截所有的资源,而Interceptor只会拦截Spring环境中的资源。