弱弱地问一下,可以通过java应用程序直接使用google map api么?不通过浏览器 弱弱地问一下,请问可以通过java应用程序直接使用google map api么?不通过浏览器访问 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://code.google.com/apis/maps/documentation/mapsdata/developers_guide_java.html 谢谢楼上的链接啊! 英语看得我头大啊,能稍微解释一下么?是如何不用通过浏览器就可以访问google web 服务的呢? 可以 通过HttpClient 后台发起请求,给你段代码参考/** * @param requestURL 要请求的地址 * @return * @throws Exception */ private static String getHtml(String requestURL) throws Exception{ URL url=new URL(requestURL); HttpClient client=new HttpClient(); HttpHost host=new HttpHost("localhost"); client.getHostConfiguration().setHost(host);// HttpClientParams params=new HttpClientParams(); GetMethod method=new GetMethod(url.toString()); client.executeMethod(method); //获取响应的html return method.getResponseBodyAsString(); } 一楼给的地址右上角有语言选项,选中文简体就可以了google都给封装好了,不需要HttpClient了 jpa查询mysql查不到 数据被自动清空了 jsp中如何取得a标签的id jsp连接sybase数据库出错 web程序中,怎么读取配置文件? Jsp和Servlet对象一一对应问题? SSH框架写的东西出现了莫名其妙的问题 华为IPTV的机顶盒关于播放音频 我对struts初步了解后的一点疑问 急急急!!!在Tomcat 4.X&weblogic 7 下怎样配置保护URL? 编译JSP时遇到的错误。怎办? excel导出时提示格式不一致 jsp里面怎样知道客户端浏览器已经关闭断开了连接
* @param requestURL 要请求的地址
* @return
* @throws Exception
*/
private static String getHtml(String requestURL) throws Exception{
URL url=new URL(requestURL);
HttpClient client=new HttpClient();
HttpHost host=new HttpHost("localhost");
client.getHostConfiguration().setHost(host);
// HttpClientParams params=new HttpClientParams();
GetMethod method=new GetMethod(url.toString());
client.executeMethod(method);
//获取响应的html
return method.getResponseBodyAsString();
}
google都给封装好了,不需要HttpClient了