DelegatingFilterProxy 配置

0
(0)

DelegatingFilterProxy 的filter-name对应的bean默认只能在applicationContext.xml中建立,如果想把filter-name这个bean配置到mvc的配置文件中,可以在web.xml中这么配置。

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
        <param-name>contextAttribute</param-name>
        <param-value>org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring-mvc</param-value>
    </init-param>
</filter>

spring-mvc是DispatcherServlet在web.xml中配置的servlet-name。

这篇文章有用吗?

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位评论此文章。

很抱歉,这篇文章对您没有用!

让我们改善这篇文章!

告诉我们我们如何改善这篇文章?

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据