Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

The method is undefined for the type

843840Nov 19 2007 — edited Mar 20 2009
HI I have a javabean class:
package database;

import java.util.*;
import java.io.*;

public class CompanyFormBean implements Serializable{

  private String companyparentid;		
  private String companyname;			 
  private Hashtable errors;

  //private String notify;
 public boolean validate() {
    boolean allOk=true;
    if (companyname.equals("")) {
      errors.put("companyname","Please enter your Company Name.");
      companyname="";
      allOk=false;
    }
    
    return allOk;
  }
 
  public String getErrorMsg(String s) {
    String errorMsg =(String)errors.get(s.trim());
    return (errorMsg == null) ? "":errorMsg;
  }
  
 // public CompanyFormBean(){}

  public CompanyFormBean() {

    companyparentid		= "";
    companyname			= "";
    errors = new Hashtable();
  }
  public String getCompanyparentid() {
    return companyparentid;
  }
  public String getCompanyname() {
    return companyname;
  }
  
 
  public void setCompanyparentid(String fcompanyparentid) {
    companyparentid = fcompanyparentid;
  }
  public void setCompanyname(String fcompanyname) {
    companyname = fcompanyname;
  }
  
  public void setErrors(String key, String msg) {
    errors.put(key,msg);
  }
 
}
after the form is submitted I try to display the values
<%@ page import="database.CompanyFormBean" %>

<jsp:useBean id="formHandler" class="database.CompanyFormBean" scope="session"/>
<html>
<head>
<title></title>
<meta name="Generator" content="EditPlus">
<meta name="Author: Irene Nessa" content="">
<meta name="Keywords" content="">
<meta name="Description: creates a new member account" content="">

</head>

<body>
<form name="reg" method="post" action="ProcessMemberRegistration.jsp" onsubmit='return formValidator()'>

<table>
	<tr>
	<td>Create A New Account</td>
	</tr>
	<tr>
		<td>Existing Company</td> 
		<td>
			<input type="text" name="companyparentid" value='<%=formHandler.getCompanyparentid()%>'>
			<!-- <select name="campanyparentid" onchange="setcompany(this)"> 
				<option>Better Homes</option>
				<option>Emaar</option>
			</select> 
		     <font size="" color="#FF0033"><b><i>OR</i></b></font>-->
		</td>
	</tr>
	<tr>
		<td>Company Name *</td>
		<td><input type="text" name="companyname" value='<%=formHandler.getCompanyname()%>'>
		</td>
	</tr>
	
</table>
<br>
	<br>
	<input type="reset">&nbsp;&nbsp;<input type="submit" value='Check Form' />
</form>
</body>
</html>
But I keep getting the following errors:*The method getCompanyparentid() is undefined for the type CompanyFormBean* But it defind and the bean class complies. Any idea what am doing wrong.

thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 17 2009
Added on Nov 19 2007
6 comments
10,371 views