@Resource public Response.Content onlineFriends() { String userId = ConversationState.getCurrent().getIdentity().getUserId(); JSONArray json = getOnlineFriends(userId); return Response.ok(json.toString()).withMimeType("application/json; charset=UTF-8").withHeader("Cache-Control", "no-cache"); }