스프링 빈 XML 파일에 정의 된 특정 스프링 빈을 얻고 자하는 스프링 프로젝트가있다. 내 Spring bean XML 파일은 /WEB-INF/spring/root-context.xml
에 있습니다. 내가 컴파일 할 때 여기에 스프링 빈을 얻을 수 없다.
ApplicationContext context = new ClassPathXmlApplicationContext("/WEB-INF/spring/root-context.xml");
은 내가 오류입니다 :
parsing XML document from class path resource [WEB-INF/spring/root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [WEB-INF/spring/root-context.xml] cannot be opened because it does not exist
예, 알고 싶습니다. 그러나 원하는 것은 web-inf에있는 XML 파일이 MVPath 레이어와 ClassPathXmlApplicationContext를 사용하는 간단한 서비스 레이어 클래스 모두에서 액세스 할 수 있다는 것입니다. 이것을 할 수있는 방법이 있습니까? –
@Abdessamad BOUTGAYOUT 나는 대답을 편집했다. –