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.
포럼 보다가.. 가져옴..
'JAVA > Framework' 카테고리의 다른 글
[link]spring ide (0) | 2005.04.27 |
---|---|
JdbcTemplate.queryForInt(String arg0, Object arg1) 편리하군 ㅋㅋ (0) | 2005.03.29 |
[struts] Validator 기초.. (0) | 2005.02.25 |
[spring] LocalSessionFactoryBean 설정에서... (0) | 2005.02.24 |
[hibernate]net.sf.hibernate.LazyInitializationException (0) | 2005.02.22 |