|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.jsf.FacesContextUtils
public abstract class FacesContextUtils
Convenience methods to retrieve the root WebApplicationContext for a given FacesContext. This is e.g. useful for accessing a Spring context from custom JSF code.
Analogous to Spring's WebApplicationContextUtils for the ServletContext.
ContextLoader
,
WebApplicationContextUtils
Constructor Summary | |
---|---|
FacesContextUtils()
|
Method Summary | |
---|---|
static WebApplicationContext |
getRequiredWebApplicationContext(javax.faces.context.FacesContext fc)
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet. |
static WebApplicationContext |
getWebApplicationContext(javax.faces.context.FacesContext fc)
Find the root WebApplicationContext for this web app, which is typically loaded via ContextLoaderListener or ContextLoaderServlet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FacesContextUtils()
Method Detail |
---|
public static WebApplicationContext getWebApplicationContext(javax.faces.context.FacesContext fc)
Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.
fc
- FacesContext to find the web application context for
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
public static WebApplicationContext getRequiredWebApplicationContext(javax.faces.context.FacesContext fc) throws IllegalStateException
Will rethrow an exception that happened on root context startup, to differentiate between a failed context startup and no context at all.
fc
- FacesContext to find the web application context for
IllegalStateException
- if the root WebApplicationContext could not be foundWebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |