摘要:
XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); // 创建解析器。 XmlPullParser parser = factory.newPullParser(); //FileInputStream fis = new FileInputStream("f:\\students.xml"); parser.se... 阅读全文
摘要:
* 继承HttpServlet后要重写doGet()、doPost()方法 * web服务器 * 1:tomcat.是开源的并且是用java语言来编写。它是免费的。用于中小型的项目。 * 2:weblogic,webSphere,用于中大型,它是收费的。 * tomcat服务器的目录 1. bin; 阅读全文
摘要:
* {} 大括号表示对象,[] 方括号表示数组或集合 * 单个对象用JsonObject * 多个对象用JsonArray JSON生成 JSON解析 阅读全文
摘要:
* 步骤: 1. new一个URL对象 2. new一个HttpURLConnection对象 3. connection连接 4. getResponseCode() 5. 读取流 阅读全文
摘要:
* 步骤: 1. 创建HttpClient对象 2. 创建HttpGet或者HttpPost对象。将地址传给构造方法。 3. 让HttpClient对象执行请求。得到响应对象HttpResponse 4. 从HttpResponse对象中得到响应码。 5. 判断响应码是否为200,如果200则获得H 阅读全文