One part of Struts where I'd like to do some additions is to form
initialization. Most of the form Objects I have require prepopulation
out of EJBs. What I'd like to do is specify for a form anothe object
that is the factory for that form, and values for properties of the
factory that should be set before creating the form.
in Struts config:
<struts-config>
<form-beans>
<form-bean
name="caretoolSearchForm"
factory="caretoolSearchFormFactory"/>
etc:
<form-factories>
<form-factory
name="caretoolSearchFormFactory"
class="com.getcare.caretool.SearchFormFactory" />
etc:
Then
public interface ActionFormFactory {
public ActionForm create();
}
Is there a better way to go about doing this? Am i reinventing the
wheel?