Example usage for org.springframework.web.context ConfigurableWebApplicationContext setServletConfig

List of usage examples for org.springframework.web.context ConfigurableWebApplicationContext setServletConfig

Introduction

In this page you can find the example usage for org.springframework.web.context ConfigurableWebApplicationContext setServletConfig.

Prototype

void setServletConfig(@Nullable ServletConfig servletConfig);

Source Link

Document

Set the ServletConfig for this web application context.

Usage

From source file:org.sarons.spring4me.web.filter.PageFilter.java

protected ConfigurableWebApplicationContext initPageApplicationContext() {
    WebApplicationContext root = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
    ///*from w ww  .  j  av  a  2  s .  co  m*/
    ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils
            .instantiateClass(contextClass);
    wac.setParent(root);
    wac.setServletContext(getServletContext());
    wac.setServletConfig(new DelegatingServletConfig(getServletContext()));
    wac.setNamespace(getNamespace());
    wac.setConfigLocation(getWidgetConfigLocation());
    wac.refresh();
    //
    return wac;
}

From source file:org.pentaho.platform.web.servlet.JAXRSServlet.java

protected ApplicationContext getAppContext() {

    ConfigurableWebApplicationContext wac = new XmlWebApplicationContext() {
        @Override/*  w  w  w . jav  a 2  s.c  o m*/
        protected Resource getResourceByPath(String path) {
            return new FileSystemResource(new File(path));
        }
    };

    wac.setServletContext(getServletContext());
    wac.setServletConfig(getServletConfig());
    wac.setNamespace(getServletName());
    String springFile = PentahoSystem.getApplicationContext()
            .getSolutionPath("system" + File.separator + "pentahoServices.spring.xml"); //$NON-NLS-1$ //$NON-NLS-2$
    wac.setConfigLocations(new String[] { springFile });
    wac.refresh();

    return wac;
}