/**
* @param args
*/
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) {
}
}
加载的是conf包下面的,conf包在src下的第一层包。Spring_Base.xml文件可以导入其他spring文件比如
<import resource="Spring_Dao.xml" />
<import resource="Spring_Database.xml" />
<import resource="Spring_XNet.xml" />
<import resource="ServerConfig.xml" />
远程调用
在服务端的spring文件了里配置
<bean id="Service1"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<!--<property name="serviceUrl"
value="${ecas.address}/项目名称/remoting/MyService" />-->
<property name="serviceUrl"
value="http://127.0.0.1:8080/项目名称/remoting/MyService" />
。。。。。。。。。。。。。。。。。
版权原因,完整文章,请参考如下:远程调用