|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.springframework.web.portlet.context.PortletApplicationContextUtils2
public class PortletApplicationContextUtils2
Convenience methods for retrieving the root
PortletApplicationContext for a given
PortletContext. This is e.g. useful for accessing a Spring
context from within custom web views or Struts actions.
Note that there are more convenient ways of accessing the root context for many portlet frameworks, either part of Spring or available as external library. This helper class is just the most generic way to access the root context.
ContextLoaderFilter,
FrameworkPortlet,
DispatcherPortlet| Field Summary | |
|---|---|
static String |
ROOT_PORTLET_APPLICATION_CONTEXT_LOADER_ATTRIBUTE
Context attribute to bind root PortletContextLoader |
| Constructor Summary | |
|---|---|
PortletApplicationContextUtils2()
|
|
| Method Summary | |
|---|---|
static PortletApplicationContext |
getPortletApplicationContext(javax.portlet.PortletContext pc)
Find the root PortletApplicationContext for this portlet application, which is typically loaded via PortletContextLoaderListener. |
static PortletApplicationContext |
getPortletApplicationContext(javax.portlet.PortletContext pc,
String attrName)
Find a custom PortletApplicationContext for this web application. |
static PortletApplicationContext |
getRequiredPortletApplicationContext(javax.portlet.PortletContext pc)
Find the root PortletApplicationContext for this portlet application, which is typically loaded via ContextLoaderFilter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ROOT_PORTLET_APPLICATION_CONTEXT_LOADER_ATTRIBUTE
PortletContextLoader
| Constructor Detail |
|---|
public PortletApplicationContextUtils2()
| Method Detail |
|---|
public static PortletApplicationContext getRequiredPortletApplicationContext(javax.portlet.PortletContext pc)
throws IllegalStateException
ContextLoaderFilter.
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 portlet application context for
IllegalStateException - if the root PortletApplicationContext could not be foundPortletApplicationContextUtils2#ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTEpublic static PortletApplicationContext getPortletApplicationContext(javax.portlet.PortletContext pc)
PortletContextLoaderListener.
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 nonePortletApplicationContextUtils2#ROOT_PORTLET_APPLICATION_CONTEXT_ATTRIBUTE
public static PortletApplicationContext getPortletApplicationContext(javax.portlet.PortletContext pc,
String attrName)
pc - PortletContext to find the web application context forattrName - the name of the PortletContext attribute to look for
null if none
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||