「 SPRING 」 十二月 04, 2022
为非全局路径配置 Filter 的两种方法
文章字数 16k 阅读约需 15 mins.
原文地址:https://wyiyi.github.io/amber/2022/12/01/filter-note/
Filter 上加 @WebFilter (javax.servlet.annotation.WebFilter),指定 value,启动类加 @ServletComponentScan
【注意】:@ServletComponentScan 这个注解仅对内嵌的 tomcat 生效,如果使用单独的 tomcat,这种方式无效。
示例一:
@WebFilter(filterName ...
查看全文