三种Spring加载机制

方法一. 在main方法中启动Spring

ApplicationContext ac = new XmlApplicationContext("applicationContext.xml");

 

方法二. 利用Spring自带的Servlet启动, 配置好Servlet, 加载Servlet的时候, 就初始化了WebApplicationContext

 

方法三. 利用Spring自带的Listener启动, 装配好Listener, 加载Listener的时候, 就初始化了WebApplcaitionContext

posted on 2018-11-24 17:17  ert999  阅读(312)  评论(0编辑  收藏  举报

导航