code: public ModelAndView putRule(long id, HttpServletRequest request,
              HttpServletResponse response) throws IOException {
          Rule oldRule = ruleDao.getRule(id);
          if (oldRule == null) {
              return new ModelAndView(
                      view,
                      "object",
                      new SimpleError(
                              "Rule "
                                      + id
                                      + " does not exist.  To create a new rule POST it to /rules",
                              404));
          }
  
          Rule newRule = (Rule) view.deserializeRequest(request);
          newRule.setId(id);
  
          String comment = "Changed by REST client: "
                  + request.getHeader("User-agent");
          if (request.getHeader("Comment") != null) {
              comment = request.getHeader("Comment");
          }
  
          String user = "" + request.getRemoteUser() + "@"
                  + request.getRemoteAddr();
          if (request.getHeader("User") != null) {
              user = request.getHeader("User") + " via " + user;
          }
  
          RuleChange change = new RuleChange(oldRule, RuleChange.UPDATED,
                  new Date(), user, comment);
          change.setRule(newRule);
  
          ruleDao.saveRule(newRule, change);
          return new ModelAndView(view, "object", change);
      }
docs: PUT /rules/:id
  
  Updates the rule with the given id, noting the change in the change log.
  
  Optional extra headers: Comment - A comment that will appear in the
  change log. User - End-user who requested the change.
  
  @param id
  @param request
  @param response
  @return
  @throws IOException