code: public void includeTemplatePart(String target, String element, Map<String, Object> parameterMap)
      throws JspException {
  
          // store current site root and URI
          String currentSiteRoot = getRequestContext().getSiteRoot();
          String currentUri = getRequestContext().getUri();
  
          try {
              // set site root and URI to display template part correct
              getRequestContext().setSiteRoot(getSiteRoot());
              getRequestContext().setUri(getTemplateUri());
              // include the template part
              include(target, element, parameterMap);
          } finally {
              // reset site root and requested URI to status JSP
              getRequestContext().setSiteRoot(currentSiteRoot);
              getRequestContext().setUri(currentUri);
          }
      }
docs: Include a template part to display on the error page.<p>
  
  @param target the target uri of the file in the OpenCms VFS (can be relative or absolute)
  @param element the element (template selector) to display from the target
  @param parameterMap a map of the request parameters
  
  @throws JspException in case there were problems including the target