how to download web pages by submit a form?
<p>I want to download a web page with a form, I need to fill this form and submit it and then get the return page, like this:</p>

<ul>
<li><a href="http://www.ebi.ac.uk/Rebholz-srv/MeshUP/" rel="nofollow">http://www.ebi.ac.uk/Rebholz-srv/MeshUP/</a></li>
</ul>

<p>When I fill the text area with <strong>bone</strong>, it will show some words in the text area, which is what I want. But my code can't finish this function, the following is my code:</p>

<pre><code>import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class DownForm {
   public static void doSubmit(String url, Map&lt;String, String&gt; data) throws Exception {
        URL siteUrl = new URL(url);
        HttpURLConnection conn = (HttpURLConnection) siteUrl.openConnection();
        conn.setRequestMethod("POST");
        conn.setDoOutput(true);
        conn.setDoInput(true);
        DataOutputStream out = new DataOutputStream(conn.getOutputStream());
        Set keys = data.keySet();
        Iterator keyIter = keys.iterator();
        String content = "";
        for(int i=0; keyIter.hasNext(); i++) {
            Object key = keyIter.next();
            if(i!=0) {
                content += "&amp;";
            }
            content += key + "=" + URLEncoder.encode(data.get(key), "UTF-8");
        }
        System.out.println(content);
        out.writeBytes(content);
        out.flush();
        out.close();
        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line = "";
        while((line=in.readLine())!=null) {
            System.out.println(line);
        }
        in.close();
    }

    public static void main(String args[]){
    Map&lt;String, String&gt; data = new HashMap&lt;String, String&gt;();
    data.put("meshDataForm", "Pain and incapacity");
    try {
        doSubmit("http://www.ebi.ac.uk/Rebholz-srv/MeshUP/", data);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
}
</code></pre>
