code: @Deprecated
      public boolean forwardToErrorPage(String rootPath) {
  
          try {
  
              // get the site of the the error page resource
              CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(rootPath);
  
              // initialize a CMS object for the given resource
              CmsObject clone = OpenCms.initCmsObject(getCmsObject());
              if (site != null) {
                  clone.getRequestContext().setSiteRoot(site.getSiteRoot());
              }
              String relPath = clone.getRequestContext().removeSiteRoot(rootPath);
              clone.getRequestContext().setUri(relPath);
  
              // create a new flex controller together with its flex request/response
              // initialized with the context of the error page
              CmsFlexController ori = CmsFlexController.getController(getRequest());
              CmsFlexController controller = new CmsFlexController(
                  clone,
                  clone.readResource(relPath),
                  ori.getCmsCache(),
                  getRequest(),
                  getResponse(),
                  false,
                  false);
              // controller.setForwardMode(true);
              CmsFlexController.setController(getRequest(), controller);
              CmsFlexRequest f_req = new CmsFlexRequest(getRequest(), controller);
              CmsFlexResponse f_res = new CmsFlexResponse(getResponse(), controller, false, false);
              controller.push(f_req, f_res);
  
              // send the forward
              CmsRequestUtil.forwardRequest(
                  OpenCms.getStaticExportManager().getVfsPrefix() + relPath,
                  getRequest(),
                  getResponse());
  
          } catch (Throwable e) {
              // something went wrong log the exception and return false
              LOG.error(e.getMessage(), e);
              return false;
          }
          // return success flag
          return true;
      }
docs: Tries to forward to the configured error page for the current site root if present.<p>
  
  @param rootPath the resource to be used as error page
  
  @return <code>true</code> if the forward was successful performed, <code>false</code> otherwise
  
  @deprecated will not work for container pages and other pages using cms:include tags