锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av中文无码字幕色不卡,亚洲精品天堂在线观看,亚洲春色在线视频http://www.tkk7.com/jackstudio/category/12671.htmlzh-cnWed, 28 Feb 2007 04:09:40 GMTWed, 28 Feb 2007 04:09:40 GMT60spring鏈変笁縐嶅惎鍔ㄦ柟寮?浣跨敤ContextLoaderServlet,ContextLoaderListener鍜孋ontextLoaderPlugIn.http://www.tkk7.com/jackstudio/archive/2006/11/09/80060.htmljackstudiojackstudioThu, 09 Nov 2006 02:40:00 GMThttp://www.tkk7.com/jackstudio/archive/2006/11/09/80060.htmlhttp://www.tkk7.com/jackstudio/comments/80060.htmlhttp://www.tkk7.com/jackstudio/archive/2006/11/09/80060.html#Feedback0http://www.tkk7.com/jackstudio/comments/commentRss/80060.htmlhttp://www.tkk7.com/jackstudio/services/trackbacks/80060.htmlspring鏈変笁縐嶅惎鍔ㄦ柟寮?浣跨敤ContextLoaderServlet,ContextLoaderListener鍜孋ontextLoaderPlugIn.
鐪嬩竴涓婥ontextLoaderListener鐨勬簮鐮?榪欐槸涓涓猄ervletContextListener
/**
聽 * Initialize the root web application context.
聽 */
聽public void contextInitialized(ServletContextEvent event) {
聽 this.contextLoader = createContextLoader();
聽 this.contextLoader.initWebApplicationContext(event.getServletContext());
聽}

聽 /**
聽 * Create the ContextLoader to use. Can be overridden in subclasses.
聽 * @return the new ContextLoader
聽 */
聽protected ContextLoader createContextLoader() {
聽 return new ContextLoader();
聽}

聽contextLoader鐨勬簮鐮?br />聽public WebApplicationContext initWebApplicationContext(ServletContext servletContext)
聽聽 throws BeansException {

聽 long startTime = System.currentTimeMillis();
聽 if (logger.isInfoEnabled()) {
聽聽 logger.info("Root WebApplicationContext: initialization started");
聽 }
聽 servletContext.log("Loading Spring root WebApplicationContext");

聽 try {
聽聽 // Determine parent for root web application context, if any.
聽聽 ApplicationContext parent = loadParentContext(servletContext);

聽聽 WebApplicationContext wac = createWebApplicationContext(servletContext, parent);
聽聽 servletContext.setAttribute(
聽聽聽聽 WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);

聽聽 if (logger.isInfoEnabled()) {
聽聽聽 logger.info("Using context class [" + wac.getClass().getName() +
聽聽聽聽聽 "] for root WebApplicationContext");
聽聽 }
聽聽 if (logger.isDebugEnabled()) {
聽聽聽 logger.debug("Published root WebApplicationContext [" + wac +
聽聽聽聽聽 "] as ServletContext attribute with name [" +
聽聽聽聽聽 WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]");
聽聽 }

聽聽 if (logger.isInfoEnabled()) {
聽聽聽 long elapsedTime = System.currentTimeMillis() - startTime;
聽聽聽 logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms");
聽聽 }

聽聽 return wac;
聽 }
聽 catch (RuntimeException ex) {
聽聽 logger.error("Context initialization failed", ex);
聽聽 servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex);
聽聽 throw ex;
聽 }
聽 catch (Error err) {
聽聽 logger.error("Context initialization failed", err);
聽聽 servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, err);
聽聽 throw err;
聽 }
聽}
聽娉ㄦ剰WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,榪欓噷闈㈡斁浜哤ebApplicationContext,闇瑕佷嬌鐢ㄦ椂浠嶴ervletContext鍙栧嚭
聽鍙互浣跨敤WebApplicationContextUtils寰楀埌WebApplicationContext
聽public static WebApplicationContext getWebApplicationContext(ServletContext sc) {
聽 Object attr = sc.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
聽 if (attr == null) {
聽聽 return null;
聽 }
聽 if (attr instanceof RuntimeException) {
聽聽 throw (RuntimeException) attr;
聽 }
聽 if (attr instanceof Error) {
聽聽 throw (Error) attr;
聽 }
聽 if (!(attr instanceof WebApplicationContext)) {
聽聽 throw new IllegalStateException("Root context attribute is not of type WebApplicationContext: " + attr);
聽 }
聽 return (WebApplicationContext) attr;
聽}
聽鍏抽敭鐨勯棶棰樺湪浜巗truts濡備綍鍚姩鐨剆pring鐨?ContextLoaderPlugIn鐨勬簮鐮?br />聽
聽// Publish the context as a servlet context attribute.
聽 String attrName = getServletContextAttributeName();
聽 getServletContext().setAttribute(attrName, wac);

聽public String getServletContextAttributeName() {
聽 return SERVLET_CONTEXT_PREFIX + getModulePrefix();
聽}
聽涓嶅悓鍔犺澆鐨凨ey绔熺劧涓嶅悓,鍘熷洜灝辨槸WebApplicationContext鏀懼湪閭i噷鐨勯棶棰?鍙痵pring璋冪敤鐨勬椂鍊欎細鏍規嵁WebApplicationContext閲岄潰瀹氫箟鐨勯偅涓悕瀛楀幓鎵劇殑,闂鍑哄湪榪欓噷


聽鍦╯truts-config.xml涓厤緗?br />聽聽聽 <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
聽聽聽聽聽 <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
聽聽聽 </plug-in>

聽聽聽 <controller>
聽聽聽聽聽聽聽 <set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor" />
聽聽聽 </controller>


聽鍘熺悊鏄繖鏍風殑,Struts铏界劧鍙兘鏈変竴涓狝ctionServlet瀹炰緥,浣嗘槸瀵逛簬涓嶅悓鐨勫瓙搴旂敤鍒嗗埆鑳芥湁鑷繁鐨凴equestProcessor瀹炰緥姣忎釜RequestProcessor瀹炰緥鍒嗗埆瀵瑰簲涓嶅悓鐨剆truts閰嶇疆鏂囦歡銆?br />聽聽 瀛愬簲鐢ㄧ殑ProcessorClass綾誨繀欏婚噸鍐欎竴鑸氨鏄戶鎵縍equestProcessor綾伙紝鐒跺悗鍐嶅叾閰嶇疆鏂囦歡鐨刢ontroller鍏冪礌涓殑<processorClass>灞炴т腑浣滃嚭淇敼銆傞偅涔堝綋
聽 getRequestProcessor(getModuleConfig(request)).process(request,response);灝辮兘鏍規嵁request閫夋嫨鐩稿簲鐨刴oduleconfig,鍐嶆牴鎹叾<processorClass>灞炴ч夋嫨鐩稿簲鐨凴equestProcessor瀛愮被鏉ュ鐞嗙浉搴旂殑璇鋒眰浜嗐?/p>



]]>
主站蜘蛛池模板: www.亚洲日本| 亚洲日本天堂在线| 国产福利免费视频| 国产成人精品久久亚洲高清不卡 国产成人精品久久亚洲 | 亚洲一区二区三区免费| 亚洲成a人片在线观看日本麻豆| 亚洲国产精品ⅴa在线观看| 99在线视频免费观看视频 | 国产麻豆视频免费观看| 亚洲videosbestsex日本| 女人18毛片免费观看| 精品亚洲国产成人av| 亚洲国产精品一区二区三区久久 | 亚洲视频一区在线观看| 成人免费毛片内射美女-百度| 亚洲一区精品视频在线| 免费看无码自慰一区二区| 国产亚洲精品精品精品| 国产亚洲精品久久久久秋霞| 搡女人免费免费视频观看| 久久亚洲精品成人AV| 毛片视频免费观看| 无人视频在线观看免费播放影院 | 国产亚洲情侣久久精品| 国产亚洲精品成人AA片新蒲金| 久久久久国产精品免费看| 亚洲一区在线视频| 免费A级毛片无码久久版| 免费网站观看WWW在线观看| 亚洲理论精品午夜电影| 最新69国产成人精品免费视频动漫 | a国产成人免费视频| 亚洲国产成a人v在线| 免费一级毛片在线观看| 男人的天堂网免费网站| 亚洲欧美aⅴ在线资源| 国产成人A人亚洲精品无码| 免费不卡视频一卡二卡| 一个人看的www免费在线视频| 亚洲精品人成在线观看| 国产在线19禁免费观看|