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

    Map props = context.getProperties();;

    Iterator it = props.entrySet().iterator();
    StringBuffer buf = new StringBuffer();
    boolean first = true;
    buf.append("[");
    while(it.hasNext()) {
        Map.Entry pairs = (Map.Entry)it.next();
        if (first == false)
            buf.append(",\n");
        buf.append("{\"");
        buf.append(pairs.getKey());
        buf.append("\" : \"");
        buf.append(pairs.getValue());
        buf.append("\"}");
        first = false;
    }
    buf.append("]");

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

@param headers   http headers
@param ui        uri info

@return value JSON representation
ambari-views/examples/property-validator-view/src/main/java/org/apache/ambari/view/property/PropertyValidatorService.java