Hello Eddie
In the code you have to set the content type,.So if you are sending any data
or Object as it is, you have to give the code like this
String url;//some url intialize it
String obj=t1.getText();
URL u=new URL(url);
    URLConnection cn=u.openConnection();
    cn.setDoOutput(true);
    cn.setDoInput(true);
    cn.setUseCaches(false);

cn.setRequestProperty("Content-Type","Java-internal/"+obj.getClass().getName
());
    ObjectOutputStream fp1=new ObjectOutputStream(cn.getOutputStream());
    fp1.writeObject(obj);
    fp1.close();
    ObjectInputStream in=new ObjectInputStream(cn.getInputStream());
    String replay=(String)in.readObject();
    t2.setText(replay);
    in.close();

Regards
Rasmy :-) Enjoy Java


Reply via email to