我还没有接触到
Spring.我在我的系统中的一个独立java项目中看到了下面的代码.你能帮我理解下面的代码.我无法在项目中看到spring.xml – 它是否必须存在并且缺失?
appContext = new ClassPathXmlApplicationContext(new String[] { "classpath*:/META-INF/spring.xml","classpath*:myapplication-application-context.xml" });
解决方法
classpath *语法意味着Spring将在类路径中搜索名为/META-INF/spring.xml和myapplication-application-context.xml的所有资源,并将它们合并到上下文中.这包括查看项目中的JAR文件,因此主项目文件中可能没有任何可见文件.