FileSystemComponentAutoRegisterを用いて、diconファイルへの設定を行う。
<component class="org.seasar.framework.container.autoregister.FileSystemComponentAutoRegister">
<property name="instanceDef">
@org.seasar.framework.container.deployer.InstanceDefFactory@REQUEST
</property>
<initMethod name="addClassPattern">
<arg>"jp.co.examples.jsf.action.impl"</arg>
<arg>".*ActionImpl"</arg>
</initMethod>
</component>
名称が"ActionImpl"で終わるクラスをrequestスコープへ登録しています。
これは、Actionクラスは入力された内容をsetter経由で受け取ることになるためです。
component名は、クラス名の先頭1文字を小文字にし、末尾のImplを除いた値になります。
クラス名が"foo.bar.HogehogeActionImpl"の場合は
"hogehogeAction"がコンポーネント名になります。
最終更新:2010年08月27日 14:15