アットウィキロゴ
備忘録@ ウィキ
掲示板 掲示板 ページ検索 ページ検索 メニュー メニュー

備忘録@ ウィキ

Webアプリケーションでの使用

最終更新:

syusei

- view
メンバー限定 登録/ログイン

使用例


  • 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");











最近更新されたスレッド
ウィキ募集バナー