Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No getter method available

 
kumar raj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am writing an application, which uses struts and hibernate. when i try to retrive the valiues from bean, i get the following error:
E SRVE0026E: [Servlet Error]-[No getter method for property agentName of bean aMEnrollment]

The following is the code iam using...

struts-config.xml:
- the relevant form definition
<form-bean name="AMEnrollmentForm" type="com.abc.forms.AMEnrollmentForm" />
- the relevant action mapping
<action path="/AMEnrollment" type="com.abc.actions.AMEnrollmentAction">
<forward name="success" path="/jsp/am_enrollment.jsp" />
</action>

Java code:

- relevant snippets from action class

query = session.createQuery("from com.abc.entities.Agent " + params);
results= query.list();
request.setAttribute("aMEnrollments", results);


JSP:

-<jsp:useBean id="aMEnrollments" type="java.util.List" scope="request"/>
<logic:iterate id="aMEnrollment" name="aMEnrollments" scope="request" >
<td><bean:write name="aMEnrollment" property="agentName" /></td>

stacktrace:

E SRVE0026E: [Servlet Error]-[No getter method for property agentName of bean aMEnrollment]: javax.servlet.jsp.JspException: No getter method for property agentName of bean aMEnrollment
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:973)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:225)

Please help me.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Struts forum.
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are iterating through a list of enrolments, retrieving a bunch of AMEnrollment objects?
The class AMEnrollment DOES have a method public String getAgentName() right?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic