Ayuda con "Struts Nested Tag", no puedo hacerlo andar

Francisco Philip
09 de Julio del 2004
Hola, alguna ayuda con esta libreria de Tags? no puedo hacer andar, uso listas, arreglos y todos me dan lo mismo
ArrayIndexOutOfBoundsException
o IndexOutOfBoundsException (si uso List) cuando sumo el segundo elemento.
A continuacion le envio el form y el action

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;

public class NestedForm extends ActionForm {
private String action;
private String newItemName;
private List items = new ArrayList();
public NestedForm(){
items.add(new NestedObject(new Date().toString()));
}
public String getAction() {
System.out.println("ActionForm.getAction");
return action;
}

public void setAction(String action) {
System.out.println("ActionForm.setAction");
this.action = action;
}

public String getNewItemName() {
System.out.println("ActionForm.getNewItemName");
return newItemName;
}

public void setNewItemName(String newItemName) {
System.out.println("ActionForm.setNewItemName");
this.newItemName = newItemName;
}

public Object[] getItems() {
System.out.println("ActionForm.getItems");
return items.toArray();
}
public List getItemList() {
System.out.println("ActionForm.getItemList");
return items;
}
/*
public List getItems() {
System.out.println("ActionForm.getItems");
return items;
}
public void setItems(List items) {
System.out.println("ActionForm.setItems");
this.items = items;
}
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
items = new ArrayList();
}
}




import org.apache.struts.action.*;
import org.apache.struts.actions.DispatchAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class NestedAction extends DispatchAction {
static {
System.out.println("NestedAction");
}

public ActionForward add(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("NestedAction.add");
NestedForm nForm = (NestedForm) form;
ActionMessages msgs = new ActionMessages();
NestedObject nItem = new NestedObject();
nItem.setName(nForm.getNewItemName());
nForm.getItemList().add(nItem);
nForm.setNewItemName("");
if (!msgs.isEmpty()) this.saveErrors(request, msgs);

return mapping.getInputForward();
}
public ActionForward unspecified(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("NestedAction.unspecified");
return mapping.getInputForward();
}

}