Using classpathxmlapplicationcontext in a stand-alone Java class
•
Java
I haven't touched spring yet I saw the following code in a separate java project in my system You can help me understand the following code I can't see spring in the project XML – does it have to exist and be missing?
appContext = new ClassPathXmlApplicationContext(new String[] { "classpath*:/Meta-INF/spring.xml","classpath*:myapplication-application-context.xml" });
Solution
The classpath * syntax means that spring will search the classpath named / meta - inf / spring XML and myapplication application context XML and merge them into the context This includes viewing jar files in the project, so there may not be any visible files in the main project file
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码