This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comment on "No Getter Method for Property..." Error

 
Darryl A. J. Staflund
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Well I just spent a lot of time trying to address a "No Getter Method for Property..." error and though I would post my findings here for posterity.
My code was structured as follows when the error occured:
1. I had defined an abstract class C1 that in turn defined an abstract method M1 as follows:

2. I had also defined several package-scoped concrete classes C2, C3, etc. which extended C1 and its abstract M1. They took on the following form:

These classes are created using a Factory class.
3. I create a collection K populated with instances of abstract class C1.
4. When I try to iterate over collection K in my JSP page and try to display the value returned by method M1, a "No Getter Method for Property..." error arises. I don't really know why it arises as the method is defined in C1, albeit abstractly.
*****
Anyway, to make a long story short, the solution to the problem was to make method M1 a concrete method in abstract class C1. Only after I do this can I display the value returned by M1.
I guess I don't know enough about the JavaBeans specification to understand why the getter method has to be concretely defined in abstract class C1. In any event, this is a COMMON error that many Struts developers encounter so I hope this posting will prevent a lot of frustration to other users.
Cheers,
Darryl
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic