I have been working with applet servlet communication through web browser as a interface.i got strucked with a problem,

here s my applet code,
private URLConnection getServletConnection()
throws MalformedURLException, IOException {

// Connection zum Servlet öffnen
URL urlServlet = new URL(getCodeBase(), "echo");
URLConnection con = urlServlet.openConnection();

// konfigurieren
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty(
"Content-Type",
"application/x-java-serialized-object");

// und zurückliefern
return con;
}

URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(input);
oos.flush();
oos.close();

// receive result from servlet
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
String result = (String) inputFromServlet.readObject();
inputFromServlet.close();
instr.close();

and here s my servlet code
response.setContentType("application/x-java-serialized-object");

// read a String-object from applet
// instead of a String-object, you can transmit any object, which
// is known to the servlet and to the applet
InputStream in = request.getInputStream();
ObjectInputStream inputFromApplet = new ObjectInputStream(in);
String echo = (String) inputFromApplet.readObject();

// echo it to the applet
OutputStream outstr = response.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstr);
oos.writeObject(echo);
oos.flush();
oos.close();
it works fine,when applet sends a string object to servlet through ObjectOutputStream and servlet recieve it and responses the string object to applet and applet recieved that string object too...but after after applet recieved the string object from servlet, it process on that string and it tried to send that string object back to servlet,it s not working...
here is that applet code am getting problem
URLConnection con = getServletConnection();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(input);
oos.flush();
oos.close();

// receive result from servlet
InputStream instr = con.getInputStream();
ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
String result = (String) inputFromServlet.readObject();
inputFromServlet.close();
instr.close();

URLConnection con1 = getServletConnection();
OutputStream outstream1 = con.getOutputStream();
ObjectOutputStream oos1 = new ObjectOutputStream(outstream1);
oos1.writeObject(input);
oos1.flush();
oos1.close();/ i didnt this write object at servlet side......plz help me

thanks in advance