沒有使用DynaForm和它的親屬。什麼是在struts中進行多行更新的好方法(使用struts live)?
我想用一個POJO數據傳輸對象,例如,聯繫人:
public class Person {
private Long id;
private String firstName;
private String lastName;
// ... getters/setters for the fields
}
支柱中的真人形式,我們將有:
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:文本標籤看起來像在JSP中允許這樣做?如果我切換到List persons字段並使用延遲加載列表(在commons-collections中),那麼這將如何改變呢?
似乎是在struts-1.2要做到這一點沒有什麼好辦法(0.9?)
所有幫助是極大的讚賞!如果你需要更多的上下文讓我知道,我可以提供一些。
好的,我相信我已經想通了! 訣竅是每次使用BeanUtils的填充方法調用getPersons()方法時,索引getter都會創建一個元素。 代碼已完成,但我得到了一個積極的結果。 現在是3點半,我一直在這一段時間陷入困境。似乎沒有人知道答案,這讓我想用鱒魚把它們砸在腦袋裏。至於我自己的無知......我只責怪他們! – les2 2009-04-27 07:31:47