At 12:57 PM 8/6/2004, you wrote:
The problem would with Java in this case, since form is passed in.....

you could do something like
BeanUtils.copyProperties( form, DynamicActionFormFactory.createBlankForm( blah blah);
and that might work better.


public class DynamicActionFormFactory {
public static ActionForm createBlankForm(String name, String type, String[] fields) {
ActionForm form = null;
FormBeanConfig config = null;
FormPropertyConfig prop = null;
config = new FormBeanConfig();
config.setName(name);
config.setType(type);
if (fields != null) {
for (int i=0; i<fields.length; i++) {
prop = new FormPropertyConfig();
prop.setName(fields[i]);
prop.setType("java.lang.String");
prop.setInitial("");
prop.freeze();
config.addFormPropertyConfig(prop);
}
}
config.freeze();
try {
form = (ActionForm) DynaActionFormClass.createDynaActionFormClass(config).newInstance();
} catch (Exception e) {
StdOut.log("log.error",new ChainedException(e,"Exception creating blank form: " + e.getMessage()));
}
return form;
}
}


What about the ActionMapping?

Michael McGrady



Reply via email to