java.lang.IllegalStateException: Write attempted after request finished
来源:互联网 发布:hadoop编程书籍 编辑:程序博客网 时间:2024/06/06 17:41
java.lang.IllegalStateException: Write attempted after request finished
对于http连接,仅能进行一次读写,并且要先写入完毕才能打开输入流进行读操作
int responseCode = conn.getResponseCode();
DataOutputStream dos = conn.openDataOutputStream();
dos.writeUTF(name);
dos.writeUTF(PassWrod);
dos.flush();
这段代码中
把 int responseCode = conn.getResponseCode();
放在后面,即先写完再请求返回数据
=============
1. How about actually closing a connection before opening a new one?
2. It/'s http, not a socket, you can/'t keep sending and receiving data. It/'a a question answer gave. After the answer, you cannot state another question without a reconnect (or use http 1.1, but that should be transparantly). Even though you set the keep-alive request propery
3. a post works in this oder:
- init your headers
- open output steam
- write data
- check response code
- open input stream
- read data
- close all
- java.lang.IllegalStateException: Write attempted after request finished
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- Java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committe
- java.lang.IllegalStateException: Cannot forward after response has been committe
- java.lang.IllegalStateException: Cannot forward after response has been committe
- java.lang.IllegalStateException: Cannot forward after response has been commit
- java.lang.IllegalStateException: Cannot forward after response has been comm
- java.lang.IllegalStateException: Can not perform this action after onSaveIns
- java.lang.IllegalStateException: Can not perform this action after onSaveInstance
- java.lang.IllegalStateException: Cannot forward after response has been committed
- java.lang.IllegalStateException: Cannot forward after response has been committed
- C#中将dateset查询生成的表中的某个列(列sum)取出来
- 网站ICO标示怎么操作
- EXS与EXSi的区别
- QTP描述性编程
- C# 对Outlook联系人的增、删、查
- java.lang.IllegalStateException: Write attempted after request finished
- 轻量级webserver kepler/thttpd/shttpd简单对比
- 新手跟着学Asp.net MVC2 -Controller
- 最少硬币问题
- 访问地图http://clustrmaps.com/zh/admin/action.php
- table的边框线设置
- 写入位置0xcccccccc时发生访问冲突
- 回溯算法
- servfox源码分析