code: public void actionPreview() throws IOException, JspException {
  
          try {
              // save content of the editor only to the temporary file
              setEditorValues(getElementLocale());
              writeContent();
              CmsObject cloneCms = getCloneCms();
              CmsUUID tempProjectId = OpenCms.getWorkplaceManager().getTempFileProjectId();
              cloneCms.getRequestContext().setCurrentProject(getCms().readProject(tempProjectId));
              // remove eventual release & expiration date from temporary file to make preview work
              cloneCms.setDateReleased(getParamTempfile(), CmsResource.DATE_RELEASED_DEFAULT, false);
              cloneCms.setDateExpired(getParamTempfile(), CmsResource.DATE_EXPIRED_DEFAULT, false);
  
          } catch (CmsException e) {
              // show error page
              showErrorPage(this, e);
          }
  
          // get preview uri from content handler
          String previewUri = m_content.getHandler().getPreview(getCms(), m_content, getParamTempfile());
  
          // create locale request parameter
          StringBuffer param = new StringBuffer(8);
          if (previewUri.indexOf('?') != -1) {
              param.append("&");
          } else {
              param.append("?");
          }
          param.append(CmsLocaleManager.PARAMETER_LOCALE);
          param.append("=");
          param.append(getParamElementlanguage());
  
          // redirect to the temporary file with currently active element language or to the specified preview uri
          sendCmsRedirect(previewUri + param);
      }
docs: Performs the preview XML content action in a new browser window.<p>
  
  @throws IOException if redirect fails
  @throws JspException if inclusion of error page fails