摘要: HttpClient client = new DefaultHttpClient(); //http://localhost:8080/FileUpload/FileUploadServlet String path = "http://localhost:8080/FileUpload/FileUploadServlet"; HttpPost post = new HttpPost(path... 阅读全文
posted @ 2016-03-04 21:40 嘉禾世兴 阅读(371) 评论(0) 推荐(0) 编辑
摘要: * HTML不区分大小写,XML区分大小写 * 用浏览器打开xml文件,判断xml文件是否有错 * xml与html的区别 1:xml的标记可以自定义,但是html标记不可以定义。<student></student> 2:作用上。xml目的是为了传输数据,但是html更多的是为了显示数据。 3:x 阅读全文
posted @ 2016-03-04 21:38 嘉禾世兴 阅读(879) 评论(0) 推荐(0) 编辑
摘要: XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); // 创建解析器。 XmlPullParser parser = factory.newPullParser(); //FileInputStream fis = new FileInputStream("f:\\students.xml"); parser.se... 阅读全文
posted @ 2016-03-04 21:25 嘉禾世兴 阅读(204) 评论(0) 推荐(0) 编辑
摘要: * 继承HttpServlet后要重写doGet()、doPost()方法 * web服务器 * 1:tomcat.是开源的并且是用java语言来编写。它是免费的。用于中小型的项目。 * 2:weblogic,webSphere,用于中大型,它是收费的。 * tomcat服务器的目录 1. bin; 阅读全文
posted @ 2016-03-04 21:23 嘉禾世兴 阅读(260) 评论(0) 推荐(0) 编辑
摘要: * {} 大括号表示对象,[] 方括号表示数组或集合 * 单个对象用JsonObject * 多个对象用JsonArray JSON生成 JSON解析 阅读全文
posted @ 2016-03-04 21:18 嘉禾世兴 阅读(218) 评论(0) 推荐(0) 编辑
摘要: * 步骤: 1. new一个URL对象 2. new一个HttpURLConnection对象 3. connection连接 4. getResponseCode() 5. 读取流 阅读全文
posted @ 2016-03-04 21:10 嘉禾世兴 阅读(391) 评论(0) 推荐(0) 编辑
摘要: * 步骤: 1. 创建HttpClient对象 2. 创建HttpGet或者HttpPost对象。将地址传给构造方法。 3. 让HttpClient对象执行请求。得到响应对象HttpResponse 4. 从HttpResponse对象中得到响应码。 5. 判断响应码是否为200,如果200则获得H 阅读全文
posted @ 2016-03-04 21:08 嘉禾世兴 阅读(218) 评论(0) 推荐(0) 编辑