S
smarto59
this my first java rather than rmi program. I faced a little problem
with passing parameters.
I made lookup for the object in client side then defined it. the
program prompts the user
to insert three String data type statements using BufferedReader then
passes them
to the remote method. in server side the first parameter is used to
name a new file using
FileWriter and the second and third arguments to be printed in the
file.
the result: the file is created successfully but the two Strings are
not printed.
this is my a part of my code:
Client:
server:
why don't the two Strings printed :x
with passing parameters.
I made lookup for the object in client side then defined it. the
program prompts the user
to insert three String data type statements using BufferedReader then
passes them
to the remote method. in server side the first parameter is used to
name a new file using
FileWriter and the second and third arguments to be printed in the
file.
the result: the file is created successfully but the two Strings are
not printed.
this is my a part of my code:
Client:
Code:
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
remoteObject.NewFile(br.readLine(),br.readLine(),br.readLine());
br.close();
server:
Code:
public void NewFile(String name,String str1,String str2)
{
FileWriter fw = new FileWriter(name+".txt");
BufferedWriter bw = new BufferedWriter (fw);
bw.write(str1+" "+str2);
fw.flush();
bw.flush();
fw.close();
bw.close();
}
why don't the two Strings printed :x