root-context.xml
root-context.xml은 DispatcherServlet보다 상위 레벨의 전역 설정을 작성하는 파일이다.
파일 전체 내용 보기
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
</beans>
파일 상세 보기
xml 헤더
xml 문서임을 명시하는 xml 헤더 코드이다. 모든 xml 문서의 첫 번째 줄에 위치한다.
<?xml version="1.0" encoding="UTF-8"?>
기본 영역 설정
root-context.xml의 기본 설정 영역이다.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
</beans>
xmlns : 기본 XML Namespace 선언. 이 주소의 내용을 기본 태그로 사용 가능
xmlns:xsi : XML Schema Instance 스펙 정보 선언
xsi:schemaLocation : 실제 선언된 정보들의 위치를 알려주는 역할
즉, 이 문서에서는 위의 내용에 의해 다음과 같은 규칙이 적용된다.
아무런 표시 없이 태그를 사용하면 spring-beans 모듈의 내용을 사용할 수 있다.
다른 모듈이 추가로 필요할 경우 모듈 관리 탭을 이용할 수 있다.
설정 파일 모듈 관리
하단의 [Namespaces] 탭을 선택한다.

필요한 모듈을 체크한다(여기서는 context 모듈 추가. 알림창은 무시)

추가된 모듈을 확인한다.

Last updated