@GET
  @Path("/question")
  @Produces({"text/plain", "application/json"})
  public Response getQuestion(@Context HttpHeaders headers, @Context UriInfo ui) {

    String  question = context.getProperties().get(PROPERTY_QUESTION);
    String  username = context.getUsername();

    StringBuffer buf = new StringBuffer();
    buf.append("{\"question\" : \"");
    buf.append(question);
    buf.append("\", \"username\" : \"");
    buf.append(username);
    buf.append("\"}");
        
    return Response.ok(buf.toString()).build();
  }
Handles: GET /question.

@param headers   http headers
@param ui        uri info

@return favorite question representation
ambari-views/examples/favorite-view/src/main/java/org/apache/ambari/view/favorite/FavoriteService.java