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