package cn.itcast.spring3.demo1;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class SpringTest1 {
@Test
//传统开发
public void demo1(){
//高度耦合
HelloService helloService = new HelloServiceImpl();
helloService.sayHello();
}
/* @Test
//spring开发
public void demo2(){
//创建一个工厂类
//ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
HelloService helloService =(H
关于spring的ApplicationContext接口的两个子类ClassPathXmlApplicatioonContext和FileSystemXmlApplicationContext
最新推荐文章于 2022-05-14 12:07:21 发布
package cn.itcast.spring3.demo1;import org.junit.Test;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import org.sp...
摘要由CSDN通过智能技术生成