File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes No getter method for property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No getter method for property " Watch "No getter method for property " New topic

No getter method for property

Sharma Vedula

Joined: May 02, 2007
Posts: 9
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

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"/>

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.


Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32803

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Sharma Vedula

Joined: May 02, 2007
Posts: 9
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
I agree. Here's the link:
subject: No getter method for property
It's not a secret anymore!