//reset(..) myList = ListUtils.lazyList(new java.util.ArrayList(), new Factory() { public Object create() { return new ObjectTypeInMyList(); } });
The question I have is in regard to this wiki about Indexed properties and LazyLists...
http://wiki.apache.org/struts/StrutsCatalogLazyList
For my Lists in my ActionForms I provide no getMyList(int index) method, yet everything works fine.
What I'm confused about is the section in the above link titled:
"Hand Cranking lazy List in the ActionForm"
For those not wanting to look at the link it shows an ActionForm like:
---------------------------------------------------- public class SkillActionForm extends ActionForm {
protected List skills = new ArrayList();
public List getSkills() { return skills; }
// non-bean version so as not to confuse struts. public void populateSkills(List skills) { this.skills.addAll(skills); }
public void setSkills(SkillBean skill) { this.skills.add(skill); }
public SkillBean getSkills(int index) {
// automatically grow List size while (index >= skills.size()) { skills.add(new SkillBean()); }
return (SkillBean)skills.get(index);
} } ----------------------------------------------------
My question is how does Struts/BeanUtils handle two get methods that have different signatures but the same method name, and what exactly is going on?
public List getSkills() public SkillBean getSkills(int index)
For example, in my code, I do not provide a getSkills(int index) type of method yet form fields that look like...
<input type="text" name="skills[4].someSkill" value=".."/>
Will work just fine.
So what happens behind the scenes when I do not provide the getSkills(int index) method and how is it working with/or without it?
Confused, -- Rick
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]