类 XmlServletWebServerApplicationContext

所有已实现的接口:
Closeable, AutoCloseable, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ConfigurableWebServerApplicationContext, WebServerApplicationContext, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, EnvironmentCapable, ResourceLoader, ResourcePatternResolver, ThemeSource, ConfigurableWebApplicationContext, WebApplicationContext

public class XmlServletWebServerApplicationContext extends ServletWebServerApplicationContext
ServletWebServerApplicationContext which takes its configuration from XML documents, understood by an XmlBeanDefinitionReader.

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions through an extra XML file.

从以下版本开始:
1.0.0
作者:
Phillip Webb
另请参阅:
  • 构造器详细资料

    • XmlServletWebServerApplicationContext

      public XmlServletWebServerApplicationContext()
      Create a new XmlServletWebServerApplicationContext that needs to be loaded and then manually refreshed.
    • XmlServletWebServerApplicationContext

      public XmlServletWebServerApplicationContext(Resource... resources)
      Create a new XmlServletWebServerApplicationContext, loading bean definitions from the given resources and automatically refreshing the context.
      参数:
      resources - the resources to load from
    • XmlServletWebServerApplicationContext

      public XmlServletWebServerApplicationContext(String... resourceLocations)
      Create a new XmlServletWebServerApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.
      参数:
      resourceLocations - the resources to load from
    • XmlServletWebServerApplicationContext

      public XmlServletWebServerApplicationContext(Class<?> relativeClass, String... resourceNames)
      Create a new XmlServletWebServerApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.
      参数:
      relativeClass - class whose package will be used as a prefix when loading each specified resource name
      resourceNames - relatively-qualified names of resources to load
  • 方法详细资料

    • setValidating

      public void setValidating(boolean validating)
      Set whether to use XML validation. Default is true.
      参数:
      validating - if validating the XML
    • setEnvironment

      public void setEnvironment(ConfigurableEnvironment environment)

      Delegates the given environment to underlying XmlBeanDefinitionReader. Should be called before any call to load(org.springframework.core.io.Resource...).

      指定者:
      setEnvironment 在接口中 ConfigurableApplicationContext
      覆盖:
      setEnvironment 在类中 AbstractApplicationContext
    • load

      public final void load(Resource... resources)
      Load bean definitions from the given XML resources.
      参数:
      resources - one or more resources to load from
    • load

      public final void load(String... resourceLocations)
      Load bean definitions from the given XML resources.
      参数:
      resourceLocations - one or more resource locations to load from
    • load

      public final void load(Class<?> relativeClass, String... resourceNames)
      Load bean definitions from the given XML resources.
      参数:
      relativeClass - class whose package will be used as a prefix when loading each specified resource name
      resourceNames - relatively-qualified names of resources to load