달력

012018  이전 다음

  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  
  •  

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.

포럼 보다가.. 가져옴..

Posted by Tornado tornado