String urlStr = "the url/wepage what you want"; StringBuffer sb = new StringBuffer(1024*30); //30kURL url = new URL(urlStr);URLConnection urlConn = (URLConnection)(url.openConnection()); urlConn.setDoOutput(true); //表示要读取返回页面InputStream is = urlConn.getInputStream();byte[] b = new byte[256]; int i = 0; while ( (i = is.read(b)) > 0) sb.append(new String(b,0,i,"the webpage's encode,ie 'utf-8', you should change"));sb 是你想要得
<Url>http://地址?format=</Url>
获取XML中的URL
可以带参数传递
response.sendRedirect(url);
StringBuffer sb = new StringBuffer(1024*30); //30kURL url = new URL(urlStr);URLConnection urlConn = (URLConnection)(url.openConnection());
urlConn.setDoOutput(true); //表示要读取返回页面InputStream is = urlConn.getInputStream();byte[] b = new byte[256];
int i = 0;
while ( (i = is.read(b)) > 0)
sb.append(new String(b,0,i,"the webpage's encode,ie 'utf-8', you should change"));sb 是你想要得