*
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
Author

No getter method for property

Sharma Vedula
Greenhorn

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
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30551
    
152

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sharma Vedula
Greenhorn

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: http://aspose.com/file-tools
 
subject: No getter method for property