不使用 DynaForm 和它的亲戚。
我想使用 POJO 数据传输对象,例如 Person:
public class Person {
private Long id;
private String firstName;
private String lastName;
// ... getters / setters for the fields
}
在 struts 实景表单中,我们将拥有:
public class PersonUpdateForm extends SLActionForm {
String organization;
Person[] persons; // all the people will be changed to this organization; they're names and so forth can be updated at the same time (stupid, but a client might desire this)
// getters / setters + index setters / getters for persons
}
相应的 html:text 标记在 JSP 中会是什么样子以允许这样做?如果我切换到 List Persons 字段并使用延迟加载列表(在 commons-collections 中),那将如何改变thingsg?
在 struts-1.2(.9?) 中似乎没有很好的方法来做到这一点
非常感谢所有帮助!!!如果您需要更多上下文,请告诉我,我可以提供一些。