implementation for testing. Not intended for use in production applications.
Interprets resource paths as portlet context resources, that is, as paths
beneath the portlet application root. Absolute paths, for example for files
outside the portlet app root, can be accessed via "file:" URLs, as implemented
by org.springframework.core.io.DefaultResourceLoader .
| Method from org.springframework.web.portlet.context.StaticPortletApplicationContext Detail: |
public String[] getConfigLocations() {
return null;
}
|
public String getNamespace() {
return this.namespace;
}
|
public PortletConfig getPortletConfig() {
return this.portletConfig;
}
|
public PortletContext getPortletContext() {
return this.portletContext;
}
|
protected Resource getResourceByPath(String path) {
return new PortletContextResource(this.portletContext, path);
}
This implementation supports file paths beneath the root of the PortletContext. |
protected ResourcePatternResolver getResourcePatternResolver() {
return new PortletContextResourcePatternResolver(this);
}
This implementation supports pattern matching in unexpanded WARs too. |
public ServletContext getServletContext() {
return this.servletContext;
}
|
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext));
beanFactory.addBeanPostProcessor(new PortletContextAwareProcessor(this.portletContext, this.portletConfig));
beanFactory.ignoreDependencyInterface(PortletContextAware.class);
beanFactory.ignoreDependencyInterface(PortletConfigAware.class);
beanFactory.registerResolvableDependency(ServletContext.class, this.servletContext);
beanFactory.registerResolvableDependency(PortletContext.class, this.portletContext);
beanFactory.registerResolvableDependency(PortletConfig.class, this.portletConfig);
PortletApplicationContextUtils.registerPortletApplicationScopes(beanFactory);
}
|
public void setConfigLocation(String configLocation) {
if (configLocation != null) {
throw new UnsupportedOperationException("StaticPortletApplicationContext does not support config locations");
}
}
|
public void setConfigLocations(String[] configLocations) {
if (configLocations != null) {
throw new UnsupportedOperationException("StaticPortletApplicationContext does not support config locations");
}
}
|
public void setNamespace(String namespace) {
this.namespace = namespace;
if (namespace != null) {
setDisplayName("Portlet ApplicationContext for namespace '" + namespace + "'");
}
}
|
public void setParent(ApplicationContext parent) {
super.setParent(parent);
if (parent instanceof WebApplicationContext) {
this.servletContext = ((WebApplicationContext) parent).getServletContext();
}
}
|
public void setPortletConfig(PortletConfig portletConfig) {
this.portletConfig = portletConfig;
if (portletConfig != null && this.portletContext == null) {
this.portletContext = portletConfig.getPortletContext();
}
}
|
public void setPortletContext(PortletContext portletContext) {
this.portletContext = portletContext;
}
|