*
The moose likes Struts and the fly likes No getter method for bean write in Struts 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 bean write in Struts" Watch "No getter method for bean write in Struts" New topic
Author

No getter method for bean write in Struts

Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
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

Joined: Sep 19, 2008
Posts: 385
Check the scope.If possible try it with session scope.

Visit here

webpage


SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
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

Joined: Sep 19, 2008
Posts: 385
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

Joined: Oct 18, 2009
Posts: 45
Hi Siva,

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

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



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

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
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

Joined: Oct 18, 2009
Posts: 45
Hi Siva,

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

Rob
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
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

Joined: Sep 19, 2008
Posts: 385
did you visit this link?

webpage

Try some of their solutions.
Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
Hi Siva,

I was able to solve this problem . . .

Thanks for your help . . .

Rob
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
what was the problem actually?
Robert Wiscup
Ranch Hand

Joined: Oct 18, 2009
Posts: 45
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No getter method for bean write in Struts
 
Similar Threads
javax.servlet.jsp.JspException: Cannot find bean: "testList" in any scope
javax.servlet.jsp.JspException: No getter method for property: "id" of bean: "Login.LoginForm"
including content in jsp from action class ?
struts application execution problem?
Error 500 from struts-el tags