Interstage

deployment descriptorの編集

製品名:Interstage Application Server V6.0
対象プラットフォーム: Windows / Solaris / Linux

Servlet あるいは JSPのWebアプリケーションからEJBを呼び出すための「deployment descriptor」の編集を紹介します。

web.xml(deployment descriptorの編集)

ServletあるいはJSPのWebアプリケーションからEJBを呼び出す際には、deployment descriptor(web.xml)に参照するEJBを指定することが必要です。

指定タグ 説明
<ejb-ref-name> EJBオブジェクトのリファレンス名を定義します。
(java:comp/envコンテキストからの相対名)
<ejb-ref-type> EJBオブジェクトのタイプを定義します。
(SessionもしくはEntity)
<home> EJBのhomeインタフェースの完全修飾名を定義します。
<remote> EJBのremoteインタフェースの完全修飾名を定義します。
<ejb-link> リンクするJ2EEアプリケーションパッケージの中のEJB名(ejb-name)を定義します。

以下は「sample」というパッケージの「EjbOfficeSession」というEJBを参照する際の設定例です。(ネーミングサービスにはEnterprise Bean名のEjbOfficeSessionが登録されているとします)

<ejb-ref>
<ejb-ref-name>ejb/EjbOfficeSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type> <home>sample.EjbOfficeSessionHome</home> <remote>sample.EjbOfficeSessionRemote</remote>
<ejb-link>EjbOfficeSession</ejb-link>
</ejb-ref>

以下はローカルインタフェースをもつEJBの設定例です。

<ejb-local-ref>
<ejb-ref-name>ejb/EjbOfficeSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>local.EjbOfficeSessionLocalHome</local-home> <local>local.EjbOfficeSessionLocal</local>
<ejb-link>EjbOfficeSession</ejb-link>
</ejb-local-ref>

 

元のページへ戻る ページの先頭へ