spring文件最简单的使用
private static final CountDownLatch shutdownLatch = new CountDownLatch(1);
public static void main(String[] args) { // TODO Auto-generated method stub try { ApplicationContext context = new ClassPathXmlApplicationContext("conf/spring/Spring_Base.xml"); shutdownLatch.await(); } catch (InterruptedException e) { // Handle exception } }
加载的是`conf`包下面的,`conf`包在`src`下的第一层包。`Spring_Base.xml`文件可以导入其他spring文件比如
```xml
<import resource="Spring_Dao.xml" />
<import resource="Spring_Database.xml" />
<import resource="Spring_XNet.xml" />
<import resource="ServerConfig.xml" />