title: How to submit a form programmatically in Java servlet?
body: <p>I have a java servlet which get the form request from one webpage in domain A, and it would deal with the form, and would send the result in another form as a request to another webpage in domain B.</p>
  
  <p>I'm wondering how to submit the form programmatically in Java servlet? I tried to use </p>
  
  <pre><code>javax.servlet.RequestDispatcher.forward(request, response)
  </code></pre>
  
  <p>but it doesn't work because it can only forward to a resource in the same domain.</p>