|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.portlet.context.PortletApplicationContextUtils
public abstract class PortletApplicationContextUtils
Convenience methods for retrieving the root WebApplicationContext for a given PortletContext. This is e.g. useful for accessing a Spring context from within custom Portlet implementations.
ContextLoader
,
WebApplicationContextUtils
,
FrameworkPortlet
,
DispatcherPortlet
Constructor Summary | |
---|---|
PortletApplicationContextUtils()
|
Method Summary | |
---|---|
static ApplicationContext |
getRequiredWebApplicationContext(PortletContext pc)
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet. |
static ApplicationContext |
getWebApplicationContext(PortletContext pc)
Find the root WebApplicationContext for this portlet application, which is typically loaded via ContextLoaderListener or ContextLoaderServlet. |
static void |
initPortletPropertySources(MutablePropertySources propertySources,
ServletContext servletContext,
PortletContext portletContext,
PortletConfig portletConfig)
Replace Servlet - and Portlet -based stub property sources
with actual instances populated with the given context and config objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortletApplicationContextUtils()
Method Detail |
---|
public static ApplicationContext getWebApplicationContext(PortletContext pc)
Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.
pc
- PortletContext to find the web application context for
null
if none
(typed to ApplicationContext to avoid a Servlet API dependency; can usually
be casted to WebApplicationContext, but there shouldn't be a need to)WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
public static ApplicationContext getRequiredWebApplicationContext(PortletContext pc) throws IllegalStateException
Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.
pc
- PortletContext to find the web application context for
IllegalStateException
- if the root WebApplicationContext could not be foundWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
public static void initPortletPropertySources(MutablePropertySources propertySources, ServletContext servletContext, PortletContext portletContext, PortletConfig portletConfig)
Servlet
- and Portlet
-based stub property sources
with actual instances populated with the given context and config objects.
PropertySource.StubPropertySource
,
ConfigurableEnvironment.getPropertySources()
,
WebApplicationContextUtils.initServletPropertySources(MutablePropertySources, ServletContext)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |