title: How to open new page by URL with sending POST query?
body: <p>I need from one JSP open another JSP, and send POST parameters to this JSP. I need to make same result as <code>response.sendRedirect(url);</code> but using this way I cant use POST request. Also note that I can't use <code>requestDispatcher</code> because this JSP in another context. I think I need to use something like this:             </p>
  
  <pre><code>    URL url = new URL("http://www.somesite.com");
      URLConnection conn = url.openConnection();
      ....
      writer.write(data);
  </code></pre>
  
  <p>But I'm not sure that I will open new page.</p>
  
  <p>EDIT: @jaxb, yes, i tried it. But when I use it, I get only new page in existing page  (i.e. I change page1 to page2, but not open new one with sending POST data to it).</p>