刘韬 vor 2 Jahren
Ursprung
Commit
9d4806d380
1 geänderte Dateien mit 17 neuen und 10 gelöschten Zeilen
  1. 17 10
      DataFusion/src/com/zskk/control/ViewController.java

+ 17 - 10
DataFusion/src/com/zskk/control/ViewController.java

@@ -44,17 +44,24 @@ public class ViewController extends Controller {
 		
 	}
 	public void testget() {
-		Map <String,String> map = new HashMap<String,String>();
-    	map.put("institution_id", PropKit.get("institution_id"));
-    	map.put("num","30");
-		String content = postWithParameters("https://117.156.67.61:9600/butt/getExam", map);
-	    JSONObject jsonObject = JSON.parseObject(content);
-	    if (!jsonObject.getString("msg").equals("success")) {
-//			return null;
+		try {
+			Map <String,String> map = new HashMap<String,String>();
+	    	map.put("institution_id", PropKit.get("institution_id"));
+	    	map.put("num","30");
+			String content = postWithParameters("https://117.156.67.61:9600/butt/getExam", map);
+		    JSONObject jsonObject = JSON.parseObject(content);
+		    if (!jsonObject.getString("msg").equals("success")) {
+//				return null;
+			}
+			JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
+//			return jsonArray;
+			this.renderJson(jsonArray);
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+
 		}
-		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));		
-//		return jsonArray;
-		this.renderJson(jsonArray);
+		
 
 	}
 public static String postWithParameters(String url, Map<String, String> map) {