스프링 시큐리티 처리를 위한 security-context.xml 를 아래와 같이 생성하고 변경함
1. 이클립스 - 파일 - new -> 'Spring Bean Configutation File' 를 통해 신규 생성
2. 네임스페이스에서 security 항목 체크하고 생성된 <beans> 속성에서 아래 취소선 표시 부분 삭제함
** 이유 : 4.2버전까지 혀용되지만 5.0에서 버그가 발생한다고 함(p610)
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-5.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">
3. web.xml 에서 보안관련 설정 추가함 >> 바로가기
4. security.xml 소스(p612)
- xmlns:security 를 xmlns:sec 로 변경함
<?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:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- form-loging 설정(p612) -->
<sec:http>
<sec:form-login />
</sec:http>
<!-- authentication-manager(p612) -->
<sec:authentication-manager>
</sec:authentication-manager>
</beans>
'[B] Spring Note' 카테고리의 다른 글
10) ex04 프로젝트 - AOP (0) | 2018.12.04 |
---|---|
4) servlet-context.xml 를 내 프로젝트에 맞도록 변경하기 (0) | 2018.11.14 |
3) root-context.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |
2) web.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |
1) pom.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |