Groovy Documentation

## org.codehaus.groovy.grails.commons.spring
[Java] Class GrailsWebApplicationContext

    java.lang.Object
      org.springframework.context.support.GenericApplicationContext
          org.codehaus.groovy.grails.commons.spring.GrailsApplicationContext
              org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext

All Implemented Interfaces:
  ConfigurableWebApplicationContext

    public class GrailsWebApplicationContext
    extends GrailsApplicationContext

A WebApplicationContext that extends StaticApplicationContext to allow for programmatic configuration at runtime. The code is adapted from StaticWebApplicationContext.

Authors:
  Graeme

Since:
  0.3

Field Summary

Fields inherited from class GrailsApplicationContext
metaClass

Constructor Summary
`GrailsWebApplicationContext()`
`GrailsWebApplicationContext(ApplicationContext parent)`
`GrailsWebApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory)`
`GrailsWebApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory, ApplicationContext parent)`

Method Summary
`java.lang.ClassLoader` | `getClassLoader()`
`String[]` | `getConfigLocations()`
`java.lang.String` | `getNamespace()`
`protected Resource` | `getResourceByPath(java.lang.String path)` This implementation supports file paths beneath the root of the ServletContext.
`protected ResourcePatternResolver` | `getResourcePatternResolver()` This implementation supports pattern matching in unexpanded WARs too.
`ServletConfig` | `getServletConfig()`
`ServletContext` | `getServletContext()`
`protected void` | `postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)` Register ServletContextAwareProcessor.
`protected void` | `prepareBeanFactory(ConfigurableListableBeanFactory beanFactory)`
`void` | `setConfigLocation(java.lang.String configLocation)`
`void` | `setConfigLocations(String[] configLocations)`
`void` | `setNamespace(java.lang.String namespace)`
`void` | `setServletConfig(ServletConfig servletConfig)`
`void` | `setServletContext(ServletContext servletContext)` Set the ServletContext that this WebApplicationContext runs in.

Methods inherited from class GrailsApplicationContext
getMetaClass, getProperty, getTheme, invokeMethod, onRefresh, registerPrototype, registerPrototype, registerSingleton, registerSingleton, setMetaClass, setProperty

Constructor Detail

### GrailsWebApplicationContext

    public GrailsWebApplicationContext()

### GrailsWebApplicationContext

    public GrailsWebApplicationContext(ApplicationContext parent)

### GrailsWebApplicationContext

    public GrailsWebApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory)

### GrailsWebApplicationContext

    public GrailsWebApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory, ApplicationContext parent)

Method Detail

### getClassLoader

    @Override
    public java.lang.ClassLoader getClassLoader()

### getConfigLocations

    public String[] getConfigLocations()

### getNamespace

    public java.lang.String getNamespace()

### getResourceByPath

    @Override
    protected Resource getResourceByPath(java.lang.String path)

  This implementation supports file paths beneath the root of the ServletContext.
  See Also:
    ServletContextResource

### getResourcePatternResolver

    @Override
    protected ResourcePatternResolver getResourcePatternResolver()

  This implementation supports pattern matching in unexpanded WARs too.
  See Also:
    ServletContextResourcePatternResolver

### getServletConfig

    public ServletConfig getServletConfig()

### getServletContext

    public ServletContext getServletContext()

### postProcessBeanFactory

    @Override
    protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)

  Register ServletContextAwareProcessor.
  See Also:
    ServletContextAwareProcessor

### prepareBeanFactory

    @Override
    protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory)

### setConfigLocation

    public void setConfigLocation(java.lang.String configLocation)

### setConfigLocations

    public void setConfigLocations(String[] configLocations)

### setNamespace

    public void setNamespace(java.lang.String namespace)

### setServletConfig

    public void setServletConfig(ServletConfig servletConfig)

### setServletContext

    public void setServletContext(ServletContext servletContext)

  Set the ServletContext that this WebApplicationContext runs in.

Groovy Documentation