I have a action form which in turn has a collection of beans. Each of those beans has a collection of objects that need to be displayed in a drop down. So, essentially, we have a jsp page with number of rows, each row being represented by a bean. The collection in question is a drop down box in each of these rows. When I try to retrieve the collection I get the following error message: javax.servlet.ServletException: No getter method for property taskLineList of bean org.apache.struts.taglib.html.BEAN org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
The other attributes defined on the bean show up when I comment out the line displaying the drop down. Here is the jsp code snippet:
public class AdditionalItemDetailsActionForm extends BudgetSelectionActionForm {
private List detailList = Collections.EMPTY_LIST; ... . .
Here is the bean code that is part of the "detailList" collection: public class InitiativeDetailBean implements Serializable { private Long initDetailId; . . . private Collection taskLineList; . . public void setTaskLineList(Collection taskLineList) { this.taskLineList = taskLineList; }
public Collection getTaskLineList() { return taskLineList; }
The property attribute uses the getter for the bean specified by the name attribute. So you need a name attribute so Struts knows to use the InitiativeDetailBean.