Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No getter method for bean write in Struts

 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Ok . . . like so many others I'm getthing the "No getter method for property: "severity" of bean: "Defects" Error Message . . .

Here are the relevant code snippets

******** JSP ************




*********** Defect.java ***************




In my action class I'm doing a Hibernate fetch which populates a list of Defect Objects and then putting it in Request Scope:

request.setAttribute("Defects", results);

If someone could help me out here I'd appreciate it . . .

Thanks!

Rob
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the scope.If possible try it with session scope.

Visit here

webpage
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried changing the scope from Request to Session with no luck . . . does anyone else have any ideas here?

Thanks,

Rob
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rule of thumb is that the property name should start with lowercase letter.

So try changing the name to defaults.
Also
paste your Action class and struts-config.xml if possible
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,

It looks like all my property names are in lowercase . . .

********** Struts-Config



****** Action Class ********

 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing request.setAttribute("Defects", results); to request.setAttribute("defects", results); and use
<bean:write name="defects" property="severity"/>

because i was helping someone alomost like the problem the problem you have and it did resolved his problem and hope it shoud do the same for you too.

Also where did you define your forward.

I did not see one in your action class
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,

Tried that . . . Unfortunately, that didn't work either . . . hmmmm

Rob
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert Wiscup wrote:Hi Siva,

Tried that . . . Unfortunately, that didn't work either . . . hmmmm

Did you mention the forward.The return type shoud be mapping.findForward("success/failure");
Rob
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you visit this link?

webpage

Try some of their solutions.
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,

I was able to solve this problem . . .

Thanks for your help . . .

Rob
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what was the problem actually?
 
Robert Wiscup
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,

Actually I abandoned that approach and used a different approach which worked fine . . . below is some of the code I used in my solution . . .

I really appreciate your help . . .

Thanks!

Rob

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic