try {
URL url = new URL("http://localhost/SameTimeApp/DownloadDatServlet");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("GET");
httpURLConnection.setDoOutput(true);
httpURLConnection.getInputStream();
} catch (Exception e1) {
e1.printStackTrace();
}
主要是用到URL这个class
详见:[url]http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html[/url]