81,122
社区成员




HttpURLConnection jconn = null;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
URL url = new URL(strUrl);
jconn = (HttpURLConnection) url.openConnection();
jconn.setDoOutput(true);
jconn.setDoInput(true);
jconn.connect();
InputStream in = jconn.getInputStream();
byte[] buf = new byte[4096];
int bytesRead = 0;
while ((bytesRead = in.read(buf)) != -1) {
byteArrayOutputStream.write(buf, 0, bytesRead);
}
String strRead = new String(byteArrayOutputStream.toByteArray(), "GBK");
HttpClient client = new HttpClient();
StringBuffer sb = new StringBuffer();
GetMethod getMethod = new GetMethod(strUrl);
int statusCode;
statusCode = client.executeMethod(getMethod);
if (statusCode == HttpStatus.SC_OK) {
BufferedReader bf = new BufferedReader(new InputStreamReader(getMethod.getResponseBodyAsStream(), coder));
String inputLine = null;
while ((inputLine = bf.readLine()) != null) {
sb.append(inputLine).append("\n");
}
bf.close();
else if((searchform.condition.value).length==0)
{
alert("查询内容不能为空!");
searchform.condition.focus();
}
else
{
searchform.condition.value = convertDBFormat(searchform.condition.value);
searchform.submit();
}
}
else
{
searchform.minprice.value = myTrim(searchform.minprice.value);