使用例
- spring.jarをWEB-INF/libにコピー
- web.xmlにリスナー登録
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
- ApplicationContextの取得
FacesContext ctx = FacesContext.getInstance();
WebApplicationContext wac =
WebApplicationContextUtils.getWebApplicationContext(
(ServletContext)ctx.getExternalContext().getContext());
Test testBean = wac.getBean("test");