• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No getter method for property

 
Sharma Vedula
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

<nested:iterate property="detailList" indexId="detailIndex">
....
.
.
<nested:select styleId="initList" property="taskId" disabled="<%=readOnlyBool.booleanValue()%>" styleClass="clsValueInput">
<option value="0">--Select--</option>
<html ptionsCollection property="taskLineList" label="description" value="taskId"/>
</nested:select>

Here is the form code:

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;
}

Any help would be greatly appreciated.

Thanks

Sharma
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34237
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sharma,
Welcome to JavaRanch!

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.
 
Sharma Vedula
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. Here is our code:

<html ptionsCollection property="taskLineList" name="InitiativeDetailBean" label="description" value="taskId"/>

And here is the new error we are getting:

javax.servlet.ServletException: Cannot find bean InitiativeDetailBean in any scope
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic