I am getting this error: Cannot create bean of class checkbox.Client
I do not know why ???? The following is my code for the class. I am trying to
read records from a file readDB()
and using jsp be able to get the values for the record such as getcuid()
and go to the next file record nextRecord().
package checkbox;
import java.io.*;
import java.util.StringTokenizer;
public class Client {
public String cuid;
public String first_name;
public String last_name;
public String work_phone;
public String email;
public String work_address;
public String home_address;
public String RC;
public String RCBS;
public Client next;
//Constructor
public Client(String[] Value, Client new_client)
{
cuid = Value[0];
first_name = Value[1];
last_name = Value[2];
work_phone = Value[3];
email = Value[4];
work_address = Value[5];
home_address = Value[6];
RC = Value[7];
RCBS = Value[8];
next = new_client;
}
public void readDB() {
String filePath = "C:\\demo\\clients.txt";
// Initialize list head
Client head = null;
// Read File
try {
BufferedReader in = new BufferedReader(new FileReader(filePath));
String line;
String[] Value = new String[8];
int x=0;
try {
// Read each record
while ((line = in.readLine())!= null) {
// Break record into columns
StringTokenizer st = new StringTokenizer (line,"\t");
while (st.hasMoreTokens()) {
Value[x]=st.nextToken();
x++;
}
// Create Client Object
head = new Client(Value, head);
}
in.close();
}
catch (IOException e) {
}
}
catch (IOException e) {
}
}
public String getcuid() {
return cuid;
}
public String getfirst_name() {
return first_name;
}
public String getlast_name() {
return last_name;
}
public String getwork_phone() {
return work_phone;
}
public String getemail() {
return email;
}
public String gethome_address() {
return home_address;
}
public String getRC() {
return RC;
}
public String getRCBS() {
return RCBS;
}
public int nextRecord() {
int EOF = 0;
int NEXT = 1;
next = next.next;
if (next != null ) {
return NEXT;
}
else {
return EOF;
}
}
}
Thanks,
Pedro
(303) 624-1545
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets