测试页面
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="http://localhost:5001/">
<input type="text" name="textfield">
<input type="text" name="textfield2">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>服务器端监听的5001端口,当页面表单提交的时候,得到一个socket连接,得到的socket输入流如下:
POST / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: localhost:5001
Content-Length: 42
Connection: Keep-Alive
Cache-Control: no-cache我怎么看不到页面表单的数据啊?
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="http://localhost:5001/">
<input type="text" name="textfield">
<input type="text" name="textfield2">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>服务器端监听的5001端口,当页面表单提交的时候,得到一个socket连接,得到的socket输入流如下:
POST / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: localhost:5001
Content-Length: 42
Connection: Keep-Alive
Cache-Control: no-cache我怎么看不到页面表单的数据啊?
解决方案 »
- 怎样构建这样的Constructor
- 我把数据库里的数据存到了一个BufferedInputStream ,怎么分离出他原来的数据啊?有没有知道的,谢谢!
- 求教java中一个方法覆盖的问题!!!
- robot截屏时的问题
- 遇到这样的JAVA问题,在线等.
- 多个component使用同一个ActionListener,怎样判断哪个产生了action?
- 高分求:JIVE2。5源代码
- 为什么我的查询没有结果呢?
- 请问application能播放音乐么?
- jbuilder7安装过程中罕见的问题,求见高手!!!
- 我自己改的一个程序不知那出错了!!请改正一下!!
- 大侠进来帮帮忙,我要用Xerces分析一个XML文件(内存中的数据),要找出特定几个元素的所有记录,怎么实现,希望给代码,谢谢
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
StringBuffer sb = new StringBuffer();
String line = br.readLine();
while (true)
{
sb.append(line+"\n");
if(line.equals(""))
break;
line = br.readLine();
}
break;
这个有问题:while(br.readLine()==null).......
int i = 0;
while (br.ready() && (i = br.read()) != -1)
{
sb.append( (char) i);
}
不知用readLine()方法该怎么写?大家讨论下啊
表单是string上传,
string str ;
str.getbytes[];
通过byte在socket上传!