code: protected String getLocationForCreatedResource(HttpServletRequest req, String objId) {
          StringBuffer url = req.getRequestURL();
          UriTemplate template = new UriTemplate(url.append("/{objId}/").toString());
          return template.expand(objId).toASCIIString();
      }
docs: Append the ID of the object that was created to the original request URL and return it.
  
  @param req The HttpServletRequest object
  @param objId The ID to append
  @return The complete appended URL