Browse Source

ContextLoaderListener extends ContextLoader

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@317 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
426d84d3f8
  1. 15
      org.springframework.web/src/main/java/org/springframework/web/context/ContextLoaderListener.java
  2. 2
      org.springframework.web/src/main/java/org/springframework/web/util/Log4jWebConfigurer.java

15
org.springframework.web/src/main/java/org/springframework/web/context/ContextLoaderListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2008 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.
@ -31,7 +31,7 @@ import javax.servlet.ServletContextListener; @@ -31,7 +31,7 @@ import javax.servlet.ServletContextListener;
* @since 17.02.2003
* @see org.springframework.web.util.Log4jConfigListener
*/
public class ContextLoaderListener implements ServletContextListener {
public class ContextLoaderListener extends ContextLoader implements ServletContextListener {
private ContextLoader contextLoader;
@ -41,21 +41,30 @@ public class ContextLoaderListener implements ServletContextListener { @@ -41,21 +41,30 @@ public class ContextLoaderListener implements ServletContextListener {
*/
public void contextInitialized(ServletContextEvent event) {
this.contextLoader = createContextLoader();
if (this.contextLoader == null) {
this.contextLoader = this;
}
this.contextLoader.initWebApplicationContext(event.getServletContext());
}
/**
* Create the ContextLoader to use. Can be overridden in subclasses.
* @return the new ContextLoader
* @deprecated in favor of simply subclassing ContextLoaderListener itself
* (which extends ContextLoader, as of Spring 3.0)
*/
@Deprecated
protected ContextLoader createContextLoader() {
return new ContextLoader();
return null;
}
/**
* Return the ContextLoader used by this listener.
* @return the current ContextLoader
* @deprecated in favor of simply subclassing ContextLoaderListener itself
* (which extends ContextLoader, as of Spring 3.0)
*/
@Deprecated
public ContextLoader getContextLoader() {
return this.contextLoader;
}

2
org.springframework.web/src/main/java/org/springframework/web/util/Log4jWebConfigurer.java

@ -183,7 +183,7 @@ public abstract class Log4jWebConfigurer { @@ -183,7 +183,7 @@ public abstract class Log4jWebConfigurer {
*/
private static boolean exposeWebAppRoot(ServletContext servletContext) {
String exposeWebAppRootParam = servletContext.getInitParameter(EXPOSE_WEB_APP_ROOT_PARAM);
return (exposeWebAppRootParam == null || Boolean.valueOf(exposeWebAppRootParam).booleanValue());
return (exposeWebAppRootParam == null || Boolean.valueOf(exposeWebAppRootParam));
}
}

Loading…
Cancel
Save