title: Calling servlet from another servlet
body: <p>I have two servlets which are running on different tomcat servers.</p>
  
  <p>I and trying to call a  servlet1 from servlet2 in the following way and wanted to write an object to output stream.</p>
  
  <pre><code>URL url=new URL("http://msyserver/abc/servlet1");
  URLConnection con=url.openConnection();
  con.setDoOutput(true);
  con.setDoInput(true);
  OutputStream os=con.getOutputStream();
  ObjectOutputStream oos=new ObjectOutputStream(os);
  oos.writeObject(pushEmailDTO);
  oos.flush();
  oos.close();
  </code></pre>
  
  <p>The problem is that i am unable to hit the servlet? I cannot figure out what i am missing.</p>