Google创始人Larry Page在1996的Java交流组里问的菜鸟问题
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Google创始人Larry Page在1996的Java交流组里问的菜鸟问题,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1811字,纯文字阅读大概需要3分钟。
内容图文
![Google创始人Larry Page在1996的Java交流组里问的菜鸟问题](/upload/InfoBanner/zyjiaocheng/739/d7588375fc134da4a89fa24e87615b74.jpg)
下面是他的问题。
I have a web robot which is a Java app. I need to be able to set the
User-Agent field in the HTTP header in order to be a good net citizen (so
people know who is accessing their server). Anyone have any ideas?
Right now, Java sends a request that includes something like:
User-Agent: Java/1.0beta2
I'd rather not rewrite all the HTTP stuff myself. I tried just searching
in the JDK for the Java/1.0beta2 figuring I could just change the string,
but I couldn't find it. Perhaps it is stored as a unicode string?
An easy method of setting the User-Agent field should probably be added to
Java, so people can properly identify their programs.
Thanks, Larry Page
文中提到的web robot估计就是后来(1998年)诞生的google。
下面是别人的回答。
Larry,
The User-Agent field is built in:
.\javasrc\src\share\sun\sun\net\www\http\HttpClient.java
It looks to be a concatentation of three items:
1) the system property "http.agent"
2) the word "Java"
3) the system property "java.version"
Since the agent string that gets built has only items 2 and
3, perhaps that means "http.agent" is blank (i.e. settable)?
If you could set "http.agent" prior to establishing the URL
connection, you may be able to get the desired effect.
Just a shot in the dark...
Joe Millar
不过在Java出现之初估计这个问题也不是很简单的。
或许你会问 what‘s the moral of this true story? 我认为是 ‘idea’ 和 ‘执行’ 比什么都重要,快速建立原型然后迭代开发,发现现实问题理清需求,最后做出好的产品来。
所以目标和做才是最重要的。
有人投资后再去雇最好的coder来refactor。。。
工程技术(programming只是其中的一种)的本质是什么?做出提高人类工作生活的产品。最好的例子就是像Steve Jobs那样。
转载于:https://www.cnblogs.com/russelljing/archive/2012/11/24/2786493.html
内容总结
以上是互联网集市为您收集整理的Google创始人Larry Page在1996的Java交流组里问的菜鸟问题全部内容,希望文章能够帮你解决Google创始人Larry Page在1996的Java交流组里问的菜鸟问题所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。