DispatcherServlet.class protected void initStrategies(ApplicationContext context) { initMultipartResolver(context); initLocaleResolver(context); initThemeResolver(context); initHandlerMappings(context); initHandlerAdapters(context); initHandlerExceptionResolvers(context); initRequestToViewNameTranslator(context); initViewResolvers(context); initFlashMapManager(context); }
protected void onRefresh(ApplicationContext context) { initStrategies(context); }
FrameworkServlet.class public void onApplicationEvent(ContextRefreshedEvent event) { refreshEventReceived = true; onRefresh(event.getApplicationContext()); } protected void onRefresh(ApplicationContext applicationcontext) { } private class ContextRefreshListener implements ApplicationListener { public void onApplicationEvent(ContextRefreshedEvent event) { FrameworkServlet.this.onApplicationEvent(event); } public volatile void onApplicationEvent( ApplicationEvent applicationevent) { onApplicationEvent((ContextRefreshedEvent) applicationevent); } final FrameworkServlet this$0; private ContextRefreshListener() { this$0 = FrameworkServlet.this; super(); } ContextRefreshListener(ContextRefreshListener contextrefreshlistener) { this(); } }
监听初始化的时候初始化
DispatcherServlet
handlerMaping handlerAdapter 等容器。
springmvc DispatcherServlet初始化..信息..
原文:http://yjm199.blog.51cto.com/4408395/1675006