MHarhen
Sep 18th, 2004, 03:39 PM
The documented method of obtaining a reference to the WebApplication context is:
WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContex t(servletContext);
Unfortunately, this does not work when using the Struts ContextLoaderPlugIn. The workaround is the following:
WebApplicationContext webApplicationContext = (WebApplicationContext)
servletContext.getAttribute(ContextLoaderPlugIn.SE RVLET_CONTEXT_PREFIX);
Can the ContextLoaderPlugIn be modified to support the documented method? It should be a simple one-line change and would have saved a lot of time.
WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContex t(servletContext);
Unfortunately, this does not work when using the Struts ContextLoaderPlugIn. The workaround is the following:
WebApplicationContext webApplicationContext = (WebApplicationContext)
servletContext.getAttribute(ContextLoaderPlugIn.SE RVLET_CONTEXT_PREFIX);
Can the ContextLoaderPlugIn be modified to support the documented method? It should be a simple one-line change and would have saved a lot of time.