@Get(contentType = "application/json") public JsonResult renderMusicianJson(Musician musician) throws UnsupportedEncodingException { return JsonResult.returnData(musician); }
public static JsonResult returnData(String href, Object data) { JsonResult r = new JsonResult(true); r.setData(data); r.setNextHref(href); return r; }
public static JsonResult returnData(Object data) { JsonResult r = new JsonResult(true); r.setData(data); return r; }
public static JsonResult fieldError(String field, String fieldMessage) { JsonResult r = new JsonResult(false, "Validation error"); r.addFieldMessage(field, fieldMessage); return r; }