多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > php框架 > 框架設計 > spring mvc3.2啟動分析

spring mvc3.2啟動分析

來源:程序員人生   發布時間:2015-04-21 09:04:54 閱讀次數:3266次
1,GenericServlet public void init(ServletConfig config) throws ServletException { this.config = config; this.init(); } 2,HttpServletBean public final void init() throws ServletException { if (logger.isDebugEnabled()) { logger.debug("Initializing servlet '" + getServletName() + "'"); } // Set bean properties from init parameters. try { PropertyValues pvs = new ServletConfigPropertyValues(getServletConfig(), this.requiredProperties); BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this); ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext()); bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader, getEnvironment())); initBeanWrapper(bw); bw.setPropertyValues(pvs, true); } catch (BeansException ex) { logger.error("Failed to set bean properties on servlet '" + getServletName() + "'", ex); throw ex; } // Let subclasses do whatever initialization they like. initServletBean();
if (logger.isDebugEnabled()) { logger.debug("Servlet '" + getServletName() + "' configured successfully"); } } 3,根據xmlWebApplicationContext創建WebApplicationContext @Override protected final void initServletBean() throws ServletException { getServletContext().log("Initializing Spring FrameworkServlet '" + getServletName() + "'"); if (this.logger.isInfoEnabled()) { this.logger.info("FrameworkServlet '" + getServletName() + "': initialization started"); } long startTime = System.currentTimeMillis(); try { this.webApplicationContext = initWebApplicationContext(); initFrameworkServlet(); } catch (ServletException ex) { this.logger.error("Context initialization failed", ex); throw ex; } catch (RuntimeException ex) { this.logger.error("Context initialization failed", ex); throw ex; } if (this.logger.isInfoEnabled()) { long elapsedTime = System.currentTimeMillis() - startTime; this.logger.info("FrameworkServlet '" + getServletName() + "': initialization completed in " + elapsedTime + " ms"); } } 4,DispatcherServlet(FrameworkServlet) protected void initStrategies(ApplicationContext context) { initMultipartResolver(context); initLocaleResolver(context); initThemeResolver(context); initHandlerMappings(context); initHandlerAdapters(context); initHandlerExceptionResolvers(context); initRequestToViewNameTranslator(context); initViewResolvers(context); initFlashMapManager(context); } 5,FrameworkServlet protected void configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext wac) { if (ObjectUtils.identityToString(wac).equals(wac.getId())) { // The application context id is still set to its original default value // -> assign a more useful id based on available information if (this.contextId != null) { wac.setId(this.contextId); } else { // Generate default id... ServletContext sc = getServletContext(); if (sc.getMajorVersion() == 2 && sc.getMinorVersion() < 5) { // Servlet <= 2.4: resort to name specified in web.xml, if any. String servletContextName = sc.getServletContextName(); if (servletContextName != null) { wac.setId(ConfigurableWebApplicationContext.APPLICATION_CONTEXT_ID_PREFIX + servletContextName + "." + getServletName()); } else { wac.setId(ConfigurableWebApplicationContext.APPLICATION_CONTEXT_ID_PREFIX + getServletName()); } } else { // Servlet 2.5's getContextPath available! wac.setId(ConfigurableWebApplicationContext.APPLICATION_CONTEXT_ID_PREFIX + ObjectUtils.getDisplayString(sc.getContextPath()) + "/" + getServletName()); } } } wac.setServletContext(getServletContext()); wac.setServletConfig(getServletConfig()); wac.setNamespace(getNamespace()); wac.addApplicationListener(new SourceFilteringListener(wac, new ContextRefreshListener())); // the wac environment's #initPropertySources will be called in any case when // the context is refreshed; do it eagerly here to ensure servlet property sources // are in place for use in any post-processing or initialization that occurs // below prior to #refresh ConfigurableEnvironment env = wac.getEnvironment(); if (env instanceof ConfigurableWebEnvironment) { ((ConfigurableWebEnvironment)env).initPropertySources(getServletContext(), getServletConfig()); } postProcessWebApplicationContext(wac); applyInitializers(wac); wac.refresh(); } 6,退出方法




生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产一区二区不卡 | 成人毛片18女人毛片 | 亚洲国产高清在线精品一区 | 欧美黑人性生活 | 亚洲精品国产一区二区三区在 | 国内一区二区三区精品视频 | 久久精品国产第一区二区 | 精品国产免费人成在线观看 | 日一区二区 | 色优影院 | 看性过程三级视频在线观看 | 欧美α一级毛片 | 成人欧美日韩高清不卡 | 国产亚洲欧美日韩在线看片 | 青青草久热精品视频在线观看 | 亚洲图片 自拍偷拍 | 日本xxxx色视频在线观看免 | 国产aaaaaaa毛片 | 免费看成人毛片日本久久 | 亚洲女人被黑人巨大进入 | 成人国产在线视频在线观看 | 黄色的网站免费观看 | 性欧美18-19sex性高清播放 | 成人免费淫片免费观看 | 麻豆一区二区免费播放网站 | 男女晚上日日麻批视频不挡 | 成人综合色站 | 蜜桃色永久入口 | 国产亚洲精品久久久久久小说 | jizzjizzjizz18中国 | 国产精品日韩欧美亚洲另类 | 性生交大片免费一级 | 国产亚洲一区二区三区不卡 | 久久亚洲精品中文字幕三区 | 国产精品亚洲精品观看不卡 | 一区二区亚洲精品 | 亚洲一区二区三区精品影院 | 亚洲一区二区精品 | 中文字幕乱码中文 | 天天爱综合网 | 亚洲欧美校园春色 |