Package com.google.appengine.repackaged.org.json

Examples of com.google.appengine.repackaged.org.json.JSONWriter


    // Get current activity
    Student student = AuthController.getCurrentStudent();
    Activity activity = StudentController.getCurrentActivity(student);
   
    // Output as JSON
    JSONWriter writer = new JSONWriter(resp.getWriter());
    try {
      writer.object().key("activity");
      if(activity != null) {
        writer.value(activity.toJSON());
      } else {
        writer.value(null);
      }
      writer.endObject();
    } catch(JSONException e) {
      resp.getWriter().println("{\"activity\":null}");
    }
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.repackaged.org.json.JSONWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.