abstractpublic class WebApplicationContextUtils (Code)
Convenience methods to retrieve the root WebApplicationContext for a given
ServletContext. This is e.g. useful for accessing a Spring context from
within custom web views or Struts actions.
getRequiredWebApplicationContext(ServletContext sc) Find the root WebApplicationContext for this web application, which is
typically loaded via ContextLoaderListener or ContextLoaderServlet.
getWebApplicationContext(ServletContext sc) Find the root WebApplicationContext for this web application, which is
typically loaded via ContextLoaderListener or ContextLoaderServlet.
Find the root WebApplicationContext for this web application, which is
typically loaded via ContextLoaderListener or ContextLoaderServlet.
Will rethrow an exception that happened on root context startup,
to differentiate between a failed context startup and no context at all.
Parameters: sc - ServletContext to find the web application context for the root WebApplicationContext for this web app, or null if none See Also:org.springframework.web.context.WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE