1.直接得到 IOC 容器对象 ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml"); 封装起来: public class ApplicationContextUtil { private static ApplicationContext applicationContext = null; public ApplicationCont…
Spring中给对象属性赋值 1.通过set方法给属性注入值 2.p名称空间 3.自动装配 4.注解 编写MVCModel调用userAction MVCModel public class MVCModel { ApplicationContext ac = new ClassPathXmlApplicationContext("com/isoftstone/xml/applicationContext.xml"); @Test public void test(){ UserAct…