/**
*
*/
package org;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import javax.servlet.http.HttpServletResponse;
/**
* @author myth
*
*/
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
InputStream in;
String s = "";
String sCurrentLine = null;
try {
//URL url = new URL("http://192.168.1.41:8080/lcws/tools/posobserver.jsp");
URL url = new URL("http://127.0.0.1:8080/Test/test.jsp");
HttpURLConnection cnn = (HttpURLConnection) url.openConnection();
cnn.connect();
in = cnn.getInputStream();
BufferedReader buffer = new BufferedReader(new InputStreamReader(in));
while ((sCurrentLine = buffer.readLine()) != null) {
s += sCurrentLine;
}
cnn.disconnect();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
posted on 2007-11-08 08:33
无声 阅读(462)
评论(0) 编辑 收藏 所属分类:
职场生活