implementation for testing. Not intended for use in production applications.
Interprets resource paths as servlet context resources, i.e. as paths beneath
the web application root. Absolute paths, e.g. for files outside the web app root,
can be accessed via "file:" URLs, as implemented by
org.springframework.core.io.DefaultResourceLoader .
Method from org.springframework.web.context.support.StaticWebApplicationContext Detail: |
public String[] getConfigLocations() {
return null;
}
|
public String getNamespace() {
return this.namespace;
}
|
protected Resource getResourceByPath(String path) {
return new ServletContextResource(this.servletContext, path);
}
This implementation supports file paths beneath the root of the ServletContext. |
protected ResourcePatternResolver getResourcePatternResolver() {
return new ServletContextResourcePatternResolver(this);
}
This implementation supports pattern matching in unexpanded WARs too. |
public ServletConfig getServletConfig() {
return this.servletConfig;
}
|
public ServletContext getServletContext() {
return this.servletContext;
}
|
public Theme getTheme(String themeName) {
return this.themeSource.getTheme(themeName);
}
|
protected void onRefresh() {
this.themeSource = UiApplicationContextUtils.initThemeSource(this);
}
Initialize the theme capability. |
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
beanFactory.registerScope(SCOPE_REQUEST, new RequestScope());
beanFactory.registerScope(SCOPE_SESSION, new SessionScope(false));
beanFactory.registerScope(SCOPE_GLOBAL_SESSION, new SessionScope(true));
beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, this.servletConfig));
beanFactory.ignoreDependencyInterface(ServletContextAware.class);
beanFactory.ignoreDependencyInterface(ServletConfigAware.class);
}
|
public void setConfigLocation(String configLocation) {
if (configLocation != null) {
throw new UnsupportedOperationException("StaticWebApplicationContext does not support config locations");
}
}
|
public void setConfigLocations(String[] configLocations) {
if (configLocations != null) {
throw new UnsupportedOperationException("StaticWebApplicationContext does not support config locations");
}
}
|
public void setNamespace(String namespace) {
this.namespace = namespace;
if (namespace != null) {
setDisplayName("WebApplicationContext for namespace '" + namespace + "'");
}
}
|
public void setServletConfig(ServletConfig servletConfig) {
this.servletConfig = servletConfig;
if (servletConfig != null && this.servletContext == null) {
this.servletContext = servletConfig.getServletContext();
}
}
|
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
}
Set the ServletContext that this WebApplicationContext runs in. |