Interface WebApplicationContext

All Superinterfaces:
org.springframework.context.ApplicationContext, org.springframework.context.ApplicationEventPublisher, org.springframework.beans.factory.BeanFactory, org.springframework.core.env.EnvironmentCapable, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.MessageSource, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver
All Known Subinterfaces:
ConfigurableWebApplicationContext
All Known Implementing Classes:
AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, GenericWebApplicationContext, GroovyWebApplicationContext, StaticWebApplicationContext, XmlWebApplicationContext

public interface WebApplicationContext extends org.springframework.context.ApplicationContext
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.

Since:
January 19, 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the ServletContext attributes environment bean in the factory.
    static final String
    Name of the ServletContext init-params environment bean in the factory.
    static final String
    Context attribute to bind root WebApplicationContext to on successful startup.
    static final String
    Scope identifier for the global web application scope: "application".
    static final String
    Scope identifier for request scope: "request".
    static final String
    Scope identifier for session scope: "session".
    static final String
    Name of the ServletContext environment bean in the factory.

    Fields inherited from interface org.springframework.beans.factory.BeanFactory

    FACTORY_BEAN_PREFIX

    Fields inherited from interface org.springframework.core.io.ResourceLoader

    CLASSPATH_URL_PREFIX

    Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver

    CLASSPATH_ALL_URL_PREFIX
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the standard Servlet API ServletContext for this application.

    Methods inherited from interface org.springframework.context.ApplicationContext

    getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate

    Methods inherited from interface org.springframework.context.ApplicationEventPublisher

    publishEvent, publishEvent

    Methods inherited from interface org.springframework.beans.factory.BeanFactory

    containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch

    Methods inherited from interface org.springframework.core.env.EnvironmentCapable

    getEnvironment

    Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory

    containsLocalBean, getParentBeanFactory

    Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory

    containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation

    Methods inherited from interface org.springframework.context.MessageSource

    getMessage, getMessage, getMessage

    Methods inherited from interface org.springframework.core.io.ResourceLoader

    getClassLoader, getResource

    Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver

    getResources