新手疑问,各位大神帮忙解惑下。在网络编程那块儿,通过浏览器访问自定义服务器,同样的代码,IE执行没有问题。为啥谷歌出现问题?两种情况见下方。
************IE浏览器***********************
F:\03java\lianxi\0911>java ServerDemo
192.168.1.104
GET / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6
.0)
Accept-Encoding: gzip, deflate
Host: 192.168.1.104:11000
DNT: 1
Connection: Keep-Alive
***************谷歌浏览器*************8
F:\03java\lianxi\0911>java ServerDemo
192.168.1.104
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: -1
at java.lang.String.checkBounds(String.java:369)
at java.lang.String.<init>(String.java:533)
at ServerDemo.main(ServerDemo.java:19)
|
|