code: @Override
      public void actionSave() throws JspException {
  
          CmsFile editFile = null;
          try {
              editFile = getCms().readFile(getParamResource(), CmsResourceFilter.ALL);
              String decodedContent = decodeContentParameter(getParamContent(), getFileEncoding(), editFile);
              try {
                  editFile.setContents(decodedContent.getBytes(getFileEncoding()));
              } catch (UnsupportedEncodingException e) {
                  throw new CmsException(
                      Messages.get().container(Messages.ERR_INVALID_CONTENT_ENC_1, getParamResource()),
                      e);
              }
              if (OpenCms.getWorkplaceManager().isXmlContentAutoCorrect()
                  && (CmsResourceTypeXmlContent.isXmlContent(editFile))) {
                  // enable auto correction in case of XML content (if configured)
                  getCms().getRequestContext().setAttribute(CmsXmlContent.AUTO_CORRECTION_ATTRIBUTE, Boolean.TRUE);
              }
              // the file content might have been modified during the write operation
              CmsFile writtenFile = getCms().writeFile(editFile);
              decodedContent = CmsEncoder.createString(writtenFile.getContents(), getFileEncoding());
              setParamContent(encodeContent(decodedContent));
              // set the modified parameter
              setParamModified(Boolean.TRUE.toString());
          } catch (CmsException e) {
              showErrorPage(e);
          }
  
          if (getAction() != ACTION_CANCEL) {
              // save successful, set save action
              setAction(ACTION_SAVE);
          }
      }
docs: Performs the save content action.<p>
  
  @see org.opencms.workplace.editors.CmsEditor#actionSave()