Interface WebApplicationContext

All Superinterfaces:
ApplicationContext, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ThemeSource
All Known Subinterfaces:
All Known Implementing Classes:
StaticWebApplicationContext, XmlWebApplicationContext

public interface WebApplicationContext
extends ApplicationContext, ThemeSource

Interface to provide configuration for a web application. This is read-only while the application is running, but may be reloaded if the implementation supports this.

This interface adds a getServletContext method to the generic ApplicationContext interface, and defines a well-known application attribute name that the root context must be bound to in the bootstrap process.

Like generic application contexts, web application contexts are hierarchical. There is a single root context per application, while each servlet in the application (including a dispatcher servlet in the MVC framework) has its own child context.

In addition to standard application context lifecycle capabilities, WebApplicationContext implementations need to detect ServletContextAware beans and invoke the setServletContext method accordingly.

January 19, 2001
$Revision: 1.11 $
Rod Johnson, Juergen Hoeller
See Also:

Field Summary
          Context attribute to bind root WebApplicationContext to on successful startup.
Fields inherited from interface
Method Summary
 javax.servlet.ServletContext getServletContext()
          Return the standard Servlet API ServletContext for this application.
Methods inherited from interface org.springframework.context.ApplicationContext
getDisplayName, getParent, getStartupDate, publishEvent
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeansOfType
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, isSingleton
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
Methods inherited from interface
Methods inherited from interface org.springframework.ui.context.ThemeSource

Field Detail


public static final java.lang.String ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
Context attribute to bind root WebApplicationContext to on successful startup.

Note: If the startup of the root context fails, this attribute can contain an exception or error as value. Use WebApplicationContextUtils for convenient lookup of the root WebApplicationContext.

See Also:
WebApplicationContextUtils.getWebApplicationContext(javax.servlet.ServletContext), WebApplicationContextUtils.getRequiredWebApplicationContext(javax.servlet.ServletContext)
Method Detail


public javax.servlet.ServletContext getServletContext()
Return the standard Servlet API ServletContext for this application.

Copyright (C) 2003-2004 The Spring Framework Project.