스프링을 사용하여 웹 서비스에 인증을 추가하려고합니다. 샘플 코드로 this resource을 언급했습니다. 하지만 불행히도 예외가 발생합니다.'springSecurityFilterChain'이라는 Bean은 스프링 편안한 웹 서비스 인증을 위해 정의되지 않았습니다.
org.springframework.beans.factory.NoSuchBeanDefinitionException은 'springSecurityFilterChain'라는 이름의 빈 구글에 많은 참조를 통해
내가 갈을 정의하지 않습니다. 그러나 나는 해결책을 찾지 못했습니다. 그럼 아무도 제가 여기서 잘못하고있는 어떤 해결책을 제안 할 수 있습니까?
다음 구성을 사용 중입니다.
봄 버전 - 3.1.1
응용 프로그램 컨텍스트 - web.xml을
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.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>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<!--<url-pattern>/*</url-pattern>-->
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
디스패처-servlet.xml에
<mvc:annotation-driven/>
<context:annotation-config/>
<context:component-scan base-package="com.em.yms.*" />
<import resource="spring-security.xml"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="index.htm">indexController</prop>
</props>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index" />
봄 보안. xxx
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_USER" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider>
<user-service id="authenticationService">
<user name="user" password="123456" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
여기에서 사용중인 종속성을 제공 할 수 있습니까? –
내가 사용하는 봄 도서관을 의미합니까? –
예 .. 스프링 의존성 –