code: @RequestMapping(value = "/save")
      @ResponseBody
      public final String save(
              @RequestParam(value = "db",
                  required = false,
                  defaultValue = "schoeller") final String dbName,
              final HttpServletResponse response) {
          logger.debug("Entering save");
  
          final RenderingContext context = createRenderingContext();
  
          final Root root = fetchRoot(dbName);
  
          setHeaders(response, root);
  
          if (!context.isAdmin()) {
              return "Sorry, you aren't authorized to do that!";
          }
  
          final String contents = new GedWriter(root).writeString();
          logger.debug("Exiting save");
          return contents;
      }
docs: Connects HTML template file with data for saving the GEDCOM file.
  
  @param dbName name of database for the lookup
  @param response the servlet response object, needed for tweaking headers
  @return a string identifying which HTML template to use.