介绍你看一篇文章http://www.javayou.com/article/httpclient.htmlhttp://www.javayou.com
解决方案 »
- tomcat的 Server Status
- 关于JSP页面首次加载的问题,欢迎大家讨论
- mysql的连接不稳定
- 为什么我刚还可以运行的,现在就出现这种问题了呢。
- Hibernate3.0 保存数据不成功..大家帮忙呀..
- 关于JSP查数据库直接倒出EXCEL问题?
- 请问如何做一个像CSDN导航栏这个的目录数呀?比较急!
- tomcat 4下编码问题!
- jsp留言板源码
- 我的web中用到一个EShop.jspt和一个ShoppingServlet,在这个servlet(ShoppingServlet)中有几句老是出错,我找了一个星期都没找到原因,请高手指教!!!
- URL?参数=值
- 请大家看看我的代码,为什么读取记录的时候经常出错——“[Microsoft][ODBC SQL Server Driver]无效的描述符索引”
{
try
{
int iHttpResult;
URL m_URL=new URL(strURL);
URLConnection m_URLConn=m_URL.openConnection();
m_URLConn.connect();
HttpURLConnection m_HttpConn=(HttpURLConnection)m_URLConn;
iHttpResult=m_HttpConn.getResponseCode();
if(iHttpResult!=HttpURLConnection.HTTP_OK)
JOptionPane.showMessageDialog(this,"无法连接...");
else
{
int iFileSize=m_URLConn.getContentLength();
InputStreamReader m_Reader=new InputStreamReader(m_URLConn.getInputStream());
char[] Buffer=new char[2048];
int iNum=0;
while(iNum>-1)
{
iNum=m_Reader.read(Buffer);
if(iNum<0)break;
//JOptionPane.showMessageDialog(this,new String(Buffer,0,iNum));
}
m_Reader.close();
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this,e.getMessage());
}
}