Hello All --
  New to struts & I'm attempting to deal with a nested indexed property.
I'm confused as to how to 1. iterate over a nested index property & 2.
how to use the indexID field of the logic:iterate tag.

Thank you-
Matt

I have a class called a Wallpack, which contains an ArrayList of Wallpaper
objects in variable wallpapers.

Relevant code from this biz object:

public class Wallpack {

  private ArrayList wallpapers = new ArrayList();

  public Wallpaper getWallpaper(int i)
  {
    return (Wallpaper) wallpapers.get(i);
  }

  public void setWallpaper(int i, Wallpaper val)
  {
    wallpapers.add(i, val);
  }
...
}

Then in wallpackedit.jsp (where the user can edit the wallpack), I'd like to
create a list of links to editing individual wallpapers.
Wallpaper0 (/editWallpaper.do?indexId=0)
Wallpaper1 (/editWallpaper.do?indexId=1)

 The below code gives the error:
javax.servlet.ServletException: No getter method for property wallpapers of
bean wallpack

<logic:iterate id="wp" type="com.fullscreen.pubtool.common.Wallpaper"
                       name="wallpack" property="wallpapers"
indexId="count">
<html:link page="/editWallpaper" paramName="count">Wallpaper
<%=count%></html:link>
</logic:iterate>


Any ideas how to do this?

Thank you-
Matt

FullScreen

Reply via email to