You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mathew, Manoj" <Ma...@principal.com> on 2004/05/03 20:44:09 UTC

issue with LazyList

Hi all i tried this code and the control os coming to initMyList() but not going inside getName().. Inside the jsp i am accessing the element by friendName[1] and i get a aeeayIndexoutofBondException.

...Pls help..


public class myTestForm extends DynaActionForm {

	public void reset(ActionMapping mapping, HttpServletRequest request) {
		List nameList = new ArrayList();
		initMyList(nameList);

		set("friendName", nameList);
	}

	private void initMyList(List nameList) {
		Factory factory = new Factory() {
			public Object create() {
				return getName();
			}

		};
		nameList = ListUtils.lazyList(new ArrayList(), factory);
	}
	public Object getName() {
		String ma = "mynamehere";
		return ma;
	}
}

thanks in advance
manoj

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org