public class TestAvgPrice {
public static void main(String[] args) {
String[] config = new String[] {
"file:E:\\apache-tomcat-7.0.40-emp\\webapps\\ROOT\\WEB-INF\\spring-common.xml",
"file:E:\\apache-tomcat-7.0.40-emp\\webapps\\ROOT\\WEB-INF\\spring-datasource.xml",
"file:E:\\apache-tomcat-7.0.40-emp\\webapps\\ROOT\\WEB-INF\\spring-hibernate.xml" };
ApplicationContext app = new FileSystemXmlApplicationContext(config);
TourService tourService = (TourService) app.getBean("tourService");
List<Tour> list = tourService.findAll(com.joytrav.oa.entity.cn.Tour.class);
System.out.println(list.size());
}
}
在java 中Spring 在主方法中 获得SERVICE
最新推荐文章于 2023-09-07 18:44:38 发布