Specify multiple profiles of equal relationships for Spring
The first way: The wildcard specifies the file (which is why we recommend naming all the configuration files for a rule)
Second way: Load multiple configuration paths, using ApplicationContext variable-length parameter construction method
The third way: similar to the second, but called the constructor of the ApplicationContext parameter as a string array
//load Spring configuration file, create Spring container object//The first wayString resource = "Com/neu/di15/spring-*.xml"; ApplicationContext AC=NewClasspathxmlapplicationcontext (Resource);/*the second way string Resource1 = "Com/neu/di15/spring-base.xml"; String Resource2 = "Com/neu/di15/spring-beans.xml"; ApplicationContext ac = new Classpathxmlapplicationcontext (Resource1, Resource2); *//*the Third Way string Resource1 = "Com/neu/di15/spring-base.xml"; String Resource2 = "Com/neu/di15/spring-beans.xml"; string[] Resources = {Resource1, resource2}; ApplicationContext ac = new Classpathxmlapplicationcontext (resources);*/
Specify multiple configuration files that contain relationships for Spring
You can import sub-profiles in the overall configuration file, either individually or by wildcards
<!---<resource= "Spring-*.xml"/>
[js-spring] Specifying multiple Spring profiles for an app