@GET
  @Path("/item")
  @Produces({"text/plain", "application/json"})
  public Response getFavoriteItem(@Context HttpHeaders headers, @Context UriInfo ui) {
    System.out.println(" context = "+context);

    String item = context.getInstanceData(INSTANCE_ITEM);
    if (item == null || item.isEmpty())
        item = context.getProperties().get(PROPERTY_DONOTKNOW);

    StringBuffer buf = new StringBuffer();
    buf.append("{\"item\" : \"");
    buf.append(item);
    buf.append("\"}");

    return Response.ok(buf.toString()).build();
  }
Handles: GET /item.

@param headers   http headers
@param ui        uri info

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