You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/07/24 04:40:01 UTC

No getter method for property action of bean org.apache.struts.taglib.html.BEAN Error

Subject: No getter method for property action of bean org.apache.struts.taglib.html.BEAN Error
From: "BillB" <bi...@verizon.net>
 ===
 I'm pulling my hair out trying to find the solution to the error below.
 I'm using Struts 1.1b and I'm new at this and starting to find my way
around
 by looking at several different examples. If anyone could help me with this
I'd
 be VERY appreciative.
 // error message
 org.apache.jasper.JasperException: No getter method for property action of
bean org.apache.struts.taglib.html.BEAN

 // get methods in MemberForm class
 public String getLicensure() { return this.licensure; }
    public String getDegree() { return this.degree; }
    public String getFirstName() { return this.firstName; }
    public String getLastName() { return this.lastName; }

    // form-bean declaration in struts-config.xml
 <form-bean name="memberForm" type="com.egps.forms.MemberForm"/>

 //action that uses the form-bean
 <action
   path="/addmember"
   type="com.egps.actions.AddMemberAction"
   scope="request"
   name="memberForm"
   validate="false"
   input="/addMember.jsp">
   <forward name="Success" path="/addMember.jsp" />
   <forward name="Failure" path="/systemFailure.jsp" />
  </action>

  // AddMemberAction class
  public class AddMemberAction extends Action {

   public ActionForward execute(ActionMapping mapping, ActionForm form,
     HttpServletRequest request, HttpServletResponse response) throws
Exception {
    // add the bean to the request here.....how?
    MemberForm memberForm = (MemberForm) form;
    String lastName = memberForm.getLastName();
    String firstName = memberForm.getFirstName();
    String licensure = memberForm.getLicensure();
    String degree = memberForm.getDegree();
    request.setAttribute("lastName", lastName);
    request.setAttribute("firstName", firstName);
    request.setAttribute("degree", degree);
    request.setAttribute("licensure", licensure);
    System.out.println("AddMemberAction.execute() - values set in request -
EXITING");
    return mapping.findForward(IConstants.SUCCESS_KEY);
   } // end execute()
} //:~

// jsp page that throws the exception
<html:form action="/addmember">
<html:hidden property="action"/>
<table border="0" width="100%">
  <tr>
    <td align="left">
      <logic:equal name="memberForm" property="action"
                  scope="request" value="Create">

      </logic:equal>
    </td>
  </tr>

<!-- First Name -->
  <tr>
    <th align="right">
      <bean:message key="label.firstName"/>
    </th>
    <td align="left">
      <html:text name="memberForm" property="firstName" size="16"
maxlength="16"/>
    </td>
  </tr>
<!-- Last Name -->
  <tr>
    <th align="right">
      <bean:message key="label.lastName"/>
    </th>
    <td align="left">
      <html:text name="memberForm" property="lastName" size="16"
maxlength="16"/>
    </td>
  </tr>
<!-- Degree -->
  <tr>
    <th align="right">
      <bean:message key="label.degree"/>
    </th>
    <td align="left">
      <html:text name="memberForm" property="degree" size="50"/>
    </td>
  </tr>

<!-- licensure -->
  <tr>
    <th align="right">
      <bean:message key="label.certification"/>
    </th>
    <td align="left">
      <html:text name="memberForm" property="licensure" size="50"/>
    </td>
  </tr>
</table>
</html:form>
Note: I've tried the html:text fields with and without the name fields
and with the property values capitalized.

Thanks,
Bill



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>