Package: grails.web.servlet.context

## [Java] Class GrailsWebApplicationContext

- grails.web.servlet.context.GrailsWebApplicationContext

- All Implemented Interfaces and Traits:
    org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource

      public class GrailsWebApplicationContext
      extends GrailsApplicationContext
      implements org.springframework.web.context.ConfigurableWebApplicationContext, org.springframework.ui.context.ThemeSource

  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
    Modifiers | Name | Description
    --- | --- | ---
    `private java.lang.String[]` | `configLocations` |
    `private GrailsApplication` | `grailsApplication` |
    `private java.lang.String` | `namespace` |
    `private javax.servlet.ServletConfig` | `servletConfig` |
    `private javax.servlet.ServletContext` | `servletContext` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class GrailsApplicationContext` | `GRAILS_ENVIRONMENT_BEAN_NAME, ctxBean, metaClass, themeSource`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsWebApplicationContext ()`
    `GrailsWebApplicationContext (GrailsApplication grailsApplication)`
    `GrailsWebApplicationContext (org.springframework.context.ApplicationContext parent)`
    `GrailsWebApplicationContext (org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, GrailsApplication grailsApplication)`
    `GrailsWebApplicationContext (org.springframework.context.ApplicationContext parent, GrailsApplication grailsApplication)`
    `GrailsWebApplicationContext (org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory)`
    `GrailsWebApplicationContext (org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, org.springframework.context.ApplicationContext parent)`
    `GrailsWebApplicationContext (org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, org.springframework.context.ApplicationContext parent, GrailsApplication grailsApplication)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected org.springframework.core.env.ConfigurableEnvironment` | `createEnvironment()`
    `` | `public java.lang.ClassLoader` | `getClassLoader()`
    `` | `public java.lang.String[]` | `getConfigLocations()`
    `` | `public org.springframework.web.context.ConfigurableWebEnvironment` | `getEnvironment()`
    `` | `private GrailsApplication` | `getGrailsApplication()`
    `` | `public java.lang.String` | `getNamespace()`
    `` | `protected org.springframework.core.io.Resource` | `getResourceByPath(java.lang.String path)` This implementation supports file paths beneath the root of the ServletContext.
    `` | `protected org.springframework.core.io.support.ResourcePatternResolver` | `getResourcePatternResolver()` This implementation supports pattern matching in unexpanded WARs too.
    `` | `public javax.servlet.ServletConfig` | `getServletConfig()`
    `` | `public javax.servlet.ServletContext` | `getServletContext()`
    `` | `protected void` | `postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)` Register ServletContextAwareProcessor.
    `` | `protected void` | `prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)`
    `` | `public void` | `setConfigLocation(java.lang.String configLocation)`
    `` | `public void` | `setConfigLocations(java.lang.String[] configLocations)`
    `` | `public void` | `setNamespace(java.lang.String namespace)`
    `` | `public void` | `setServletConfig(javax.servlet.ServletConfig servletConfig)`
    `` | `public void` | `setServletContext(javax.servlet.ServletContext servletContext)` Set the ServletContext that this WebApplicationContext runs in.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GrailsApplicationContext` | `assertBeanFactoryActive, containsBeanDefinition, getMetaClass, getProperty, getTheme, invokeMethod, onRefresh, prepareBeanFactory, registerPrototype, registerPrototype, registerSingleton, registerSingleton, setMetaClass, setProperty`

- - ### Field Detail

    - #### private java.lang.String[] configLocations

    - #### private GrailsApplication grailsApplication

    - #### private java.lang.String namespace

    - #### private javax.servlet.ServletConfig servletConfig

    - #### private javax.servlet.ServletContext servletContext

  - ### Constructor Detail

    - #### public GrailsWebApplicationContext()

    - #### public GrailsWebApplicationContext(GrailsApplication grailsApplication)

    - #### public GrailsWebApplicationContext(org.springframework.context.ApplicationContext parent)

    - #### public GrailsWebApplicationContext(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, GrailsApplication grailsApplication)

    - #### public GrailsWebApplicationContext(org.springframework.context.ApplicationContext parent, GrailsApplication grailsApplication)

    - #### public GrailsWebApplicationContext(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory)

    - #### public GrailsWebApplicationContext(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, org.springframework.context.ApplicationContext parent)

    - #### public GrailsWebApplicationContext(org.springframework.beans.factory.support.DefaultListableBeanFactory defaultListableBeanFactory, org.springframework.context.ApplicationContext parent, GrailsApplication grailsApplication)

  - ### Method Detail

    - #### @java.lang.Override protected org.springframework.core.env.ConfigurableEnvironment createEnvironment()

    - #### @java.lang.Override public java.lang.ClassLoader getClassLoader()

    - #### public java.lang.String[] getConfigLocations()

    - #### @java.lang.Override public org.springframework.web.context.ConfigurableWebEnvironment getEnvironment()

    - #### private GrailsApplication getGrailsApplication()

    - #### public java.lang.String getNamespace()

    - #### @java.lang.Override protected org.springframework.core.io.Resource getResourceByPath(java.lang.String path)

      This implementation supports file paths beneath the root of the ServletContext.

      See Also:
        org.springframework.web.context.support.ServletContextResource

    - #### @java.lang.Override protected org.springframework.core.io.support.ResourcePatternResolver getResourcePatternResolver()

      This implementation supports pattern matching in unexpanded WARs too.

      See Also:
        org.springframework.web.context.support.ServletContextResourcePatternResolver

    - #### public javax.servlet.ServletConfig getServletConfig()

    - #### public javax.servlet.ServletContext getServletContext()

    - #### @java.lang.Override protected void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)

      Register ServletContextAwareProcessor.

      See Also:
        org.springframework.web.context.support.ServletContextAwareProcessor

    - #### @java.lang.Override protected void prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)

    - #### public void setConfigLocation(java.lang.String configLocation)

    - #### public void setConfigLocations(java.lang.String[] configLocations)

    - #### public void setNamespace(java.lang.String namespace)

    - #### public void setServletConfig(javax.servlet.ServletConfig servletConfig)

    - #### public void setServletContext(javax.servlet.ServletContext servletContext)

      Set the ServletContext that this WebApplicationContext runs in.