programing

스프링 부트에서 applicationContext.xml을 자동으로 Import합니까?

mytipbox 2023. 3. 9. 21:41
반응형

스프링 부트에서 applicationContext.xml을 자동으로 Import합니까?

사용하고 있다spring-boot자동 Import를 원합니다.src/main/resources/applicationContext.xml파일.

지금까지는 spring에 Import를 명시적으로 지시했을 경우에만 동작합니다.

@EnableAutoConfiguration
@Configuration
@ImportResource({"classpath*:applicationContext.xml"})

그러나 spring-boot에는 기본값이 너무 많기 때문에 app.xml 파일의 "기본값" 이름을 누군가가 알고 있기 때문에 기본적으로 spring-boot에 의해 선택됩니다.

이름 또는 위치에 따라 기본적으로 XML 구성을 가져오는 기능은 없습니다.

문서의 이 부분을 참조하십시오.

언급URL : https://stackoverflow.com/questions/25687754/spring-boot-automatically-import-applicationcontext-xml

반응형