Play framework后台处理页面传过来的AJAX-JSON数据并给出响应

话不多少,直接上代码


public static Result finishKillActivity(){	
		ObjectNode on = Json.newObject();
		try{
			JsonNode in = request().body().asJson();//接收到的推送信息
			Logger.info("收到的推送信息" + in.toString());

			on.put("Success", true);
			return ok(on.toString());
		}catch(Exception e){
			Logger.error("失败 :" + e.getMessage(), e);
			return ok(on.toString());
		}
	}


你可能感兴趣的:(Play框架)