Spring security 为spring批处理管理添加安全性

Spring security 为spring批处理管理添加安全性,spring-security,spring-batch-admin,Spring Security,Spring Batch Admin,首先,提前谢谢 我使用的是Spring Batch Admin 1.3.1,我的流程正常工作,但现在我们的目标是应用安全性,以便只有授权人员才能访问流程。 安全设置在其他应用程序中工作正常,不符合CAS的要求 通过使用spring batch admin示例进行测试,我将安全配置文件放置在路径/META-INF/spring/cas security config.xml中,并从另一个配置xml文件导入该文件以覆盖属性或加载新的属性以确保安全。batch admin正确启动,但当我尝试访问应用程

首先,提前谢谢

我使用的是Spring Batch Admin 1.3.1,我的流程正常工作,但现在我们的目标是应用安全性,以便只有授权人员才能访问流程。 安全设置在其他应用程序中工作正常,不符合CAS的要求

通过使用spring batch admin示例进行测试,我将安全配置文件放置在路径/META-INF/spring/cas security config.xml中,并从另一个配置xml文件导入该文件以覆盖属性或加载新的属性以确保安全。batch admin正确启动,但当我尝试访问应用程序时,它会生成以下错误:

org.springframework.beans.factory.NoSuchBean定义异常:未定义名为“springSecurityFilterChain”的bean

我已经阅读了所有相关的帖子,但我找不到解决办法。我尝试过用/batch覆盖resourceService bean,但当它被访问时,其他url找不到它们,并生成404错误

我们希望保护所有重定向到CAS然后返回到batch manager菜单的内容

以下是我的配置文件:

属性负载

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<context:annotation-config />
<context:component-scan base-package="com.aneta.services" />
<!--
    SOBREESCRITURA DE LAS PROPERTIES DEL MANAGER DE SPRING BATCH 
 -->
<bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:*.properties</value>
            <value>classpath:properties/*.properties</value>

        </list>
    </property>
    <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
    <property name="ignoreResourceNotFound" value="true" />
    <property name="ignoreUnresolvablePlaceholders" value="false" />
    <property name="order" value="1" />
</bean>

<import resource="classpath:META-INF/spring/cas-security-config.xml"/>
</beans>

类路径:*.properties
类路径:properties/*.properties
Web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
        http://java.sun.com/xml/ns/j2ee
        http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
</filter>

<filter>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
    <servlet-name>Batch Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Batch Servlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd">

<context:annotation-config />
<context:component-scan base-package="com.aneta.services" />

<bean id="roleVoter" class="org.springframework.security.access.vote.RoleVoter">
    <property name="rolePrefix" value=""/>
</bean>

<bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
    <constructor-arg >
        <list>
            <ref bean="roleVoter"/>
            <bean class="org.springframework.security.web.access.expression.WebExpressionVoter"/>
            <bean class="org.springframework.security.access.vote.AuthenticatedVoter"/>
        </list>
    </constructor-arg>
</bean>


<security:http entry-point-ref="casEntryPoint" use-expressions="true" auto-config="true"
    access-decision-manager-ref="accessDecisionManager">
    <security:csrf disabled="false"/>
    <security:custom-filter position="FIRST" ref="ajaxSessionFilter"/>
    <security:custom-filter ref="requestSingleLogoutFilter" before="LOGOUT_FILTER" />
    <security:custom-filter ref="singleLogoutFilter" before="CAS_FILTER" />

    <security:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER"/>
    <security:custom-filter position="LAST" ref="loginFilter"/>

    <!-- ACCESO CON RESTRICCIONES -->
    <security:intercept-url pattern="/**" access="hasAnyAuthority('ADMINISTRATOR')" />

</security:http>

<bean id="casServiceProperties" class="org.springframework.security.cas.ServiceProperties"
    p:service="${service.base.url}"
    p:sendRenew="false" p:authenticateAllArtifacts="true" />

<bean id="casEntryPoint"
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"
    p:serviceProperties-ref="casServiceProperties" p:loginUrl="${cas.server.base.url}/login" />

<bean id="ajaxSessionFilter" class="com.psoplaneta.services.security.filters.AjaxSessionFilter">    
    <property name="homePage" value="${cas.server.base.url}/login"/>
</bean>

<bean id="loginFilter" class="com.aneta.services.security.filters.LoginFilter"> 
    <property name="errorPage" value="${service.base.url}/403"/>
    <property name="loginPage" value="${cas.server.base.url}/login"/>
</bean>


<bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter"
    p:proxyGrantingTicketStorage-ref="proxyGrantingTicketStorage"
    p:proxyReceptorUrl="/login/cas/proxyreceptor"
    p:serviceProperties-ref="casServiceProperties"
    p:authenticationManager-ref="authenticationManager">
    <property name="authenticationFailureHandler">
        <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
            <property name="defaultFailureUrl" value="/casfailed"/>
        </bean>
    </property>
    <property name="authenticationSuccessHandler">
        <bean class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler"
            p:defaultTargetUrl="/">
        </bean>
    </property>
    <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
</bean>

<bean id="proxyGrantingTicketStorage" class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl" />

<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"/>

<!-- This filter redirects to the CAS Server to signal Single Logout should be performed -->
<bean id="requestSingleLogoutFilter"
    class="org.springframework.security.web.authentication.logout.LogoutFilter"
    p:filterProcessesUrl="/j_spring_cas_security_logout">
    <constructor-arg value="${cas.server.base.url}/logout" />
    <constructor-arg >
        <bean
            class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
    </constructor-arg>
</bean>

<!-- This filter handles a Single Logout Request from the CAS Server -->
<bean id="singleLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/>

<security:authentication-manager alias="authenticationManager">
    <security:authentication-provider ref="casAuthenticationProvider"/>
</security:authentication-manager>

<bean id="casAuthenticationProvider"
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider"
    p:key="casAuthProviderKey"
    p:serviceProperties-ref="casServiceProperties">
    <property name="authenticationUserDetailsService">
        <bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
            <constructor-arg ref="userDetailService" />
        </bean>
    </property>
    <property name="ticketValidator">
        <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"
            p:proxyGrantingTicketStorage-ref="proxyGrantingTicketStorage">
            <constructor-arg index="0" value="${cas.server.base.url}" />
        </bean>
    </property>
</bean>

<bean id="userDetailService" class="com.aneta.services.security.userdetails.UserDetailsService"/>


</beans>

上下文配置位置
classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml
org.springframework.web.context.ContextLoaderListener
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*
浅滤器
org.springframework.web.filter.ShallowEtagHeaderFilter
hiddenHttpMethodFilter
org.springframework.web.filter.hiddenhttmpmethodfilter
浅滤器
/*
hiddenHttpMethodFilter
/*
批处理Servlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml
1.
批处理Servlet
/*

cas security config.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
        http://java.sun.com/xml/ns/j2ee
        http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
</filter>

<filter>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
    <servlet-name>Batch Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Batch Servlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd">

<context:annotation-config />
<context:component-scan base-package="com.aneta.services" />

<bean id="roleVoter" class="org.springframework.security.access.vote.RoleVoter">
    <property name="rolePrefix" value=""/>
</bean>

<bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
    <constructor-arg >
        <list>
            <ref bean="roleVoter"/>
            <bean class="org.springframework.security.web.access.expression.WebExpressionVoter"/>
            <bean class="org.springframework.security.access.vote.AuthenticatedVoter"/>
        </list>
    </constructor-arg>
</bean>


<security:http entry-point-ref="casEntryPoint" use-expressions="true" auto-config="true"
    access-decision-manager-ref="accessDecisionManager">
    <security:csrf disabled="false"/>
    <security:custom-filter position="FIRST" ref="ajaxSessionFilter"/>
    <security:custom-filter ref="requestSingleLogoutFilter" before="LOGOUT_FILTER" />
    <security:custom-filter ref="singleLogoutFilter" before="CAS_FILTER" />

    <security:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER"/>
    <security:custom-filter position="LAST" ref="loginFilter"/>

    <!-- ACCESO CON RESTRICCIONES -->
    <security:intercept-url pattern="/**" access="hasAnyAuthority('ADMINISTRATOR')" />

</security:http>

<bean id="casServiceProperties" class="org.springframework.security.cas.ServiceProperties"
    p:service="${service.base.url}"
    p:sendRenew="false" p:authenticateAllArtifacts="true" />

<bean id="casEntryPoint"
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"
    p:serviceProperties-ref="casServiceProperties" p:loginUrl="${cas.server.base.url}/login" />

<bean id="ajaxSessionFilter" class="com.psoplaneta.services.security.filters.AjaxSessionFilter">    
    <property name="homePage" value="${cas.server.base.url}/login"/>
</bean>

<bean id="loginFilter" class="com.aneta.services.security.filters.LoginFilter"> 
    <property name="errorPage" value="${service.base.url}/403"/>
    <property name="loginPage" value="${cas.server.base.url}/login"/>
</bean>


<bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter"
    p:proxyGrantingTicketStorage-ref="proxyGrantingTicketStorage"
    p:proxyReceptorUrl="/login/cas/proxyreceptor"
    p:serviceProperties-ref="casServiceProperties"
    p:authenticationManager-ref="authenticationManager">
    <property name="authenticationFailureHandler">
        <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
            <property name="defaultFailureUrl" value="/casfailed"/>
        </bean>
    </property>
    <property name="authenticationSuccessHandler">
        <bean class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler"
            p:defaultTargetUrl="/">
        </bean>
    </property>
    <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
</bean>

<bean id="proxyGrantingTicketStorage" class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl" />

<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"/>

<!-- This filter redirects to the CAS Server to signal Single Logout should be performed -->
<bean id="requestSingleLogoutFilter"
    class="org.springframework.security.web.authentication.logout.LogoutFilter"
    p:filterProcessesUrl="/j_spring_cas_security_logout">
    <constructor-arg value="${cas.server.base.url}/logout" />
    <constructor-arg >
        <bean
            class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
    </constructor-arg>
</bean>

<!-- This filter handles a Single Logout Request from the CAS Server -->
<bean id="singleLogoutFilter" class="org.jasig.cas.client.session.SingleSignOutFilter"/>

<security:authentication-manager alias="authenticationManager">
    <security:authentication-provider ref="casAuthenticationProvider"/>
</security:authentication-manager>

<bean id="casAuthenticationProvider"
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider"
    p:key="casAuthProviderKey"
    p:serviceProperties-ref="casServiceProperties">
    <property name="authenticationUserDetailsService">
        <bean class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
            <constructor-arg ref="userDetailService" />
        </bean>
    </property>
    <property name="ticketValidator">
        <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"
            p:proxyGrantingTicketStorage-ref="proxyGrantingTicketStorage">
            <constructor-arg index="0" value="${cas.server.base.url}" />
        </bean>
    </property>
</bean>

<bean id="userDetailService" class="com.aneta.services.security.userdetails.UserDetailsService"/>


</beans>

如果您感兴趣,我在这里介绍了使用CAS SSO激活身份验证的解决方案,我认为它对于其他类型的身份验证很有用。 在做了这么多圈之后,我看到web.xml中有两个dispatcher,并且只使用了一个,即只加载了一个配置和批处理servlet。 解决方案是创建一个调度程序,并将所有配置加载到一个调度程序中。如果,我将配置文件从覆盖的文件夹(即META-INF/spring/servlet-config.xml)中放出来,并在其中进行安全导入,必要时添加更多内容,因为这是导入新配置的正确位置

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">

<servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <!-- set to blank to ensure context is only loaded once -->
        <param-name>contextConfigLocation</param-name>
        <param-value></param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml,
        classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml,
        classpath*:/META-INF/spring/aneta-servlet-config.xml
    </param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
</filter>
<filter>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!-- SPRING SECURITY -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<!-- -->

</web-app>

mvc调度器
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
1.
mvc调度器
/*
上下文配置位置
classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml,
classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml,
classpath*:/META-INF/spring/aneta-servlet-config.xml
org.springframework.web.context.ContextLoaderListener
浅滤器
org.springframework.web.filter.ShallowEtagHeaderFilter
hiddenHttpMethodFilter
org.springframework.web.filter.hiddenhttmpmethodfilter
浅滤器
/*
hiddenHttpMethodFilter
/*
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*

我希望它对你有用

如果您感兴趣,我在这里介绍了使用CAS SSO激活身份验证的解决方案,我认为它对于其他类型的身份验证很有用。 在做了这么多圈之后,我看到web.xml中有两个dispatcher,并且只使用了一个,即只加载了一个配置和批处理servlet。 解决方案是创建一个调度程序,并将所有配置加载到一个调度程序中。如果,我将配置文件从覆盖的文件夹(即META-INF/spring/servlet-config.xml)中放出来,并在其中进行安全导入,必要时添加更多内容,因为这是导入新配置的正确位置

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">

<servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <!-- set to blank to ensure context is only loaded once -->
        <param-name>contextConfigLocation</param-name>
        <param-value></param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml,
        classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml,
        classpath*:/META-INF/spring/aneta-servlet-config.xml
    </param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</filter-class>
</filter>
<filter>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>shallowEtagHeaderFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>hiddenHttpMethodFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!-- SPRING SECURITY -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<!-- -->

</web-app>

mvc调度器
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
1.
mvc调度器
/*
上下文配置位置
classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml,
classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml,
classpath*:/META-INF/spring/aneta-servlet-config.xml
org.springframework.web.context.ContextLoaderListener
浅滤器
org.springframework.web.filter.ShallowEtagHeaderFilter
hiddenHttpMethodFilter
org.springframework.web.filter.hiddenhttmpmethodfilter
浅滤器
/*
hiddenHttpMethodFilter
/*
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*

我希望它对你有用

有什么想法吗?有什么想法吗?