The documented method of obtaining a reference to the WebApplication context is:
Unfortunately, this does not work when using the Struts ContextLoaderPlugIn. The workaround is the following:Code:WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
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.Code:WebApplicationContext webApplicationContext = (WebApplicationContext) servletContext.getAttribute(ContextLoaderPlugIn.SERVLET_CONTEXT_PREFIX);


Reply With Quote