From: Juergen H. <jho...@us...> - 2006-04-21 00:13:57
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/context In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/web/context Modified Files: Tag: mbranch-1-2 ContextLoader.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: ContextLoader.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/context/ContextLoader.java,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -C2 -d -r1.30 -r1.30.2.1 *** ContextLoader.java 13 Nov 2005 23:27:35 -0000 1.30 --- ContextLoader.java 21 Apr 2006 00:13:50 -0000 1.30.2.1 *************** *** 1,9 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 * --- 1,9 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 * *************** *** 158,172 **** /** ! * Initialize Spring's web application context for the given servlet ! * context, regarding the "contextClass" and "contextConfigLocation" ! * context-params. * @param servletContext current servlet context * @return the new WebApplicationContext ! * @throws BeansException if the context couldn't be initialized * @see #CONTEXT_CLASS_PARAM * @see #CONFIG_LOCATION_PARAM */ public WebApplicationContext initWebApplicationContext(ServletContext servletContext) ! throws BeansException { long startTime = System.currentTimeMillis(); --- 158,178 ---- /** ! * Initialize Spring's web application context for the given servlet context, ! * according to the "contextClass" and "contextConfigLocation" context-params. * @param servletContext current servlet context * @return the new WebApplicationContext ! * @throws IllegalStateException if there is already a root application context present ! * @throws BeansException if the context failed to initialize * @see #CONTEXT_CLASS_PARAM * @see #CONFIG_LOCATION_PARAM */ public WebApplicationContext initWebApplicationContext(ServletContext servletContext) ! throws IllegalStateException, BeansException { ! ! if (servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE) != null) { ! throw new IllegalStateException( ! "Cannot initialize context because there is already a root application context present - " + ! "check whether you have multiple ContextLoader* definitions in your web.xml!"); ! } long startTime = System.currentTimeMillis(); *************** *** 271,275 **** contextClassName = defaultStrategies.getProperty(WebApplicationContext.class.getName()); try { ! return Class.forName(contextClassName, true, getClass().getClassLoader()); } catch (ClassNotFoundException ex) { --- 277,281 ---- contextClassName = defaultStrategies.getProperty(WebApplicationContext.class.getName()); try { ! return ClassUtils.forName(contextClassName); } catch (ClassNotFoundException ex) { |