您的位置:首页 > 编程语言 > Java开发

springmvc DispatcherServlet初始化..信息..

2015-07-15 17:33 435 查看
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 在上下文监听的时候 在 onRefresh方法里进行 映射数据的加载
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: