texerasmo
17-06-2005, 11:01
ReadProperties read_file = new ReadProperties();
BufferedReader d;
URL ind;
String [] arr_host =null;
String _host="";
String app="";
String chiave_="";
String valore_="";
boolean controlli =true;
Hashtable listhost = null;
int pos=0;
//vado a prendere i valori nel file properties
try{
Hashtable listconn = read_file.getParamConnection("ip_host.properties");
int i = listconn.size();
System.out.println("SIZE "+ i);
for(int ct = 0; ct < i; ct++) {
chiave_="";
valore_="";
app= "host_"+ct;
System.out.println("COUNT" + ct);
_host = (String)listconn.get(app);
pos = _host.indexOf(":");
chiave_ = _host.substring(0,pos);
valore_ = _host.substring(pos+1);
System.out.println(chiave_ +" "+ valore_);
listhost.put(chiave_,valore_);
}
quando compilo non mi da errore quando lo lancio si mi da errore
listhost.put(chiave_,valore_);
dice che un valore è nullo
io ho controllato ma non mi sembra.
dov'è il trucco?
BufferedReader d;
URL ind;
String [] arr_host =null;
String _host="";
String app="";
String chiave_="";
String valore_="";
boolean controlli =true;
Hashtable listhost = null;
int pos=0;
//vado a prendere i valori nel file properties
try{
Hashtable listconn = read_file.getParamConnection("ip_host.properties");
int i = listconn.size();
System.out.println("SIZE "+ i);
for(int ct = 0; ct < i; ct++) {
chiave_="";
valore_="";
app= "host_"+ct;
System.out.println("COUNT" + ct);
_host = (String)listconn.get(app);
pos = _host.indexOf(":");
chiave_ = _host.substring(0,pos);
valore_ = _host.substring(pos+1);
System.out.println(chiave_ +" "+ valore_);
listhost.put(chiave_,valore_);
}
quando compilo non mi da errore quando lo lancio si mi da errore
listhost.put(chiave_,valore_);
dice che un valore è nullo
io ho controllato ma non mi sembra.
dov'è il trucco?