DispathcerServlet Spring Web 简易框架
DispathcerServlet Spring Web 简易框架 准备 applicationContext.xml 对应 bean 1 2 3 4 5 6 7 8 9 10 11 12 <?xml version="1.0" encoding="UTF-8"?> <beans> <bean id="fruitDao" class="com.test.dao.FruitDao"/> <bean id="fruitService" class="com.test.service.impl.FruitServiceImpl"> <property name="fruitDao" ref="fruitDao"/> </bean> <bean id="fruit" class="com.test.controller.FruitController"> <property name="fruitService" ref="fruitService"/> </bean> </beans> 通过实现 ServletContextListener 监听器接口,并重写 contextInitialized 方法获取 BeanFactory 对象放