Spring安全ldap与struts 1.1集成

时间:2014-04-21 02:36:32

标签: java ldap struts-1 spring-security-ldap

无法找到在struts 1.1应用程序中集成Spring安全ldap身份验证的步骤。

1 个答案:

答案 0 :(得分:1)

请按照以下步骤操作:

  1. 将spring.jar添加到您的项目中
  2. 在web.xml文件中,添加以下代码

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/acegi-security-config.xml
    </param-value>
    </context-param>
    
    
    <!-- Spring Security Filter -->
    
    <filter>
    <filter-name>Acegi Filter Chain Proxy</filter-name>
    <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
    <init-param>
    <param-name>targetClass</param-name>
    <param-value>org.acegisecurity.util.FilterChainProxy</param-value>
    </init-param>
    </filter>
    
    <filter-mapping>
    <filter-name>Acegi Filter Chain Proxy</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
    <filter-name>AuthenticatedFilter</filter-name>
    <filter-class>com.security.AuthenticatedFilter</filter-class>
    </filter>
    
    <filter-mapping>
    <filter-name>AuthenticatedFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
    
  3. acegi-security-config.xml,是spring安全配置文件