S2Container container = S2ContainerFactory.create("定義ファイル.xml"); インタフェース名 オブジェクト名 = (インタフェース名) container.getComponent("コンポーネント名");
<components> <component name="オブジェクト名A" class="パッケージ名.クラス名A"> <property name="変数名1">"文字列1”</property> <property name="変数名2">"文字列2”</property> </component> <component name="オブジェクト名B" class="パッケージ名.クラス名B"> </component> <component name="オブジェクト名C" class="パッケージ名.クラス名C"> <property name="変数名3">オブジェクト名B</property> </component> </components>
<components> <include path="s2struts.dicon"/> <include path="jp/co/thinkit/employee/dicon/employee.dicon"/> </components>