非启动 Spring 项目的 org.springframework.boot.context.embedded.FilterRegistrationBean 等效项?
Equivalent of org.springframework.boot.context.embedded.FilterRegistrationBean for non-Boot Spring project?
我正在尝试根据 this tutorial. I'm having some trouble adding the right filter though. Spring Boot appears to have defined the proper bean/filter, but my project is not Spring Boot, so it cannot find the FilterRegistrationBean
. Is there some sort of equivalent to this class in non-Boot versions of Spring? I also tried org.springframework.web.context.embedded.FilterRegistrationBean 在 Spring 中实现外部会话处理,但无法正确导入它(看起来该文档指的是 SNAPSHOT 版本,所以也许这个包从来都不是正确发布的一部分)。
根据您的容器配置,web.xml 或 ServletContainerInitializer
,您可以注册一个 DelegatingFilterProxy
过滤器并使其通过名称引用一个 Filter
bean在您的 ApplicationContext
.
中声明
我正在尝试根据 this tutorial. I'm having some trouble adding the right filter though. Spring Boot appears to have defined the proper bean/filter, but my project is not Spring Boot, so it cannot find the FilterRegistrationBean
. Is there some sort of equivalent to this class in non-Boot versions of Spring? I also tried org.springframework.web.context.embedded.FilterRegistrationBean 在 Spring 中实现外部会话处理,但无法正确导入它(看起来该文档指的是 SNAPSHOT 版本,所以也许这个包从来都不是正确发布的一部分)。
根据您的容器配置,web.xml 或 ServletContainerInitializer
,您可以注册一个 DelegatingFilterProxy
过滤器并使其通过名称引用一个 Filter
bean在您的 ApplicationContext
.