docs: private boolean renderContainerElement(
          HttpServletRequest request,
          CmsObject cms,
          CmsJspStandardContextBean standardContext,
          CmsContainerElementBean element,
          Locale locale,
          boolean alreadyFull)
      throws Exception {
  
          CmsTemplateContext context = (CmsTemplateContext)(request.getAttribute(
              CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT));
          if ((context == null) && alreadyFull) {
              return false;
          }
          String contextKey = null;
          if (context != null) {
              contextKey = context.getKey();
          } else {
              String rpcContextOverride = (String)request.getAttribute(
                  CmsTemplateContextManager.ATTR_RPC_CONTEXT_OVERRIDE);
              contextKey = rpcContextOverride;
          }
          boolean showInContext = shouldShowInContext(element, context != null ? context.getKey() : null);
          boolean isOnline = cms.getRequestContext().getCurrentProject().isOnlineProject();
          if (!m_editableRequest && !showInContext) {
              return false;
          }
          element.initResource(cms);
          if (!m_editableRequest && !element.isReleasedAndNotExpired()) {
              // do not render expired resources for the online project
              return false;
          }
          ServletRequest req = pageContext.getRequest();
          ServletResponse res = pageContext.getResponse();
          String containerType = getType();
          int containerWidth = getContainerWidth();
          CmsADEConfigData adeConfig = OpenCms.getADEManager().lookupConfiguration(
              cms,
              cms.getRequestContext().getRootUri());
          boolean isGroupContainer = element.isGroupContainer(cms);
          boolean isInheritedContainer = element.isInheritedContainer(cms);
          I_CmsFormatterBean formatterConfig = null;
          if (!isGroupContainer && !isInheritedContainer) {
              // ensure that the formatter configuration id is added to the element settings, so it will be persisted on save
              formatterConfig = ensureValidFormatterSettings(
                  cms,
                  element,
                  adeConfig,
                  getName(),
                  containerType,
                  containerWidth);
              element.initSettings(cms, formatterConfig, locale, request, m_settingPresets);
          }
          // writing elements to the session cache to improve performance of the container-page editor in offline project
          if (m_editableRequest) {
              getSessionCache(cms).setCacheContainerElement(element.editorHash(), element);
          }
  
          if (isGroupContainer || isInheritedContainer) {
              if (alreadyFull) {
                  return false;
              }
              List<CmsContainerElementBean> subElements;
              if (isGroupContainer) {
                  subElements = getGroupContainerElements(cms, element, req, containerType);
              } else {
                  // inherited container case
                  subElements = getInheritedContainerElements(cms, element);
              }
              // wrapping the elements with DIV containing initial element data. To be removed by the container-page editor
              printElementWrapperTagStart(cms, element, standardContext.getPage(), true);
              for (CmsContainerElementBean subelement : subElements) {
  
                  try {
                      subelement.initResource(cms);
                      boolean shouldShowSubElementInContext = shouldShowInContext(subelement, contextKey);
                      if (!m_editableRequest
                          && (!shouldShowSubElementInContext || !subelement.isReleasedAndNotExpired())) {
                          continue;
                      }
                      I_CmsFormatterBean subElementFormatterConfig = ensureValidFormatterSettings(
                          cms,
                          subelement,
                          adeConfig,
                          getName(),
                          containerType,
                          containerWidth);
                      subelement.initSettings(cms, subElementFormatterConfig, locale, request, m_settingPresets);
                      // writing elements to the session cache to improve performance of the container-page editor
                      if (m_editableRequest) {
                          getSessionCache(cms).setCacheContainerElement(subelement.editorHash(), subelement);
                      }
                      if (subElementFormatterConfig == null) {
                          if (LOG.isErrorEnabled()) {
                              LOG.error(
                                  new CmsIllegalStateException(
                                      Messages.get().container(
                                          Messages.ERR_XSD_NO_TEMPLATE_FORMATTER_3,
                                          subelement.getSitePath(),
                                          OpenCms.getResourceManager().getResourceType(
                                              subelement.getResource()).getTypeName(),
                                          containerType)));
                          }
                          // skip this element, it has no formatter for this container type defined
                          continue;
                      }
                      // execute the formatter JSP for the given element URI
                      // wrapping the elements with DIV containing initial element data. To be removed by the container-page editor
                      printElementWrapperTagStart(cms, subelement, standardContext.getPage(), false);
                      standardContext.setElement(subelement);
                      try {
                          String formatterSitePath;
                          try {
                              CmsResource formatterResource = cms.readResource(
                                  subElementFormatterConfig.getJspStructureId());
                              formatterSitePath = cms.getSitePath(formatterResource);
                          } catch (CmsVfsResourceNotFoundException ex) {
                              LOG.debug("Formatter JSP not found by id, try using path.", ex);
                              formatterSitePath = cms.getRequestContext().removeSiteRoot(
                                  subElementFormatterConfig.getJspRootPath());
                          }
                          if (shouldShowSubElementInContext) {
                              CmsJspTagInclude.includeTagAction(
                                  pageContext,
                                  formatterSitePath,
                                  null,
                                  locale,
                                  false,
                                  isOnline,
                                  null,
                                  CmsRequestUtil.getAttributeMap(req),
                                  req,
                                  res);
                          } else {
                              pageContext.getOut().print(DUMMY_ELEMENT);
                          }
                      } catch (Exception e) {
                          if (LOG.isErrorEnabled()) {
                              LOG.error(
                                  Messages.get().getBundle().key(
                                      Messages.ERR_CONTAINER_PAGE_ELEMENT_RENDER_ERROR_2,
                                      subelement.getSitePath(),
                                      subElementFormatterConfig),
                                  e);
                          }
                          printElementErrorTag(subelement.getSitePath(), subElementFormatterConfig.getJspRootPath(), e);
                      }
                      printElementWrapperTagEnd(false);
                  } catch (Exception e) {
                      if (LOG.isErrorEnabled()) {
                          LOG.error(e);
                      }
                  }
              }
              printElementWrapperTagEnd(true);
              return true;
          } else {
              boolean result = true;
              if (alreadyFull) {
                  result = false;
                  if (!showInContext) {
                      printElementWrapperTagStart(cms, element, standardContext.getPage(), false);
                      pageContext.getOut().print(DUMMY_ELEMENT);
                      printElementWrapperTagEnd(false);
                  }
              } else {
                  String formatter = null;
                  try {
                      if (formatterConfig != null) {
                          try {
                              CmsResource formatterResource = cms.readResource(formatterConfig.getJspStructureId());
                              formatter = cms.getSitePath(formatterResource);
                          } catch (CmsVfsResourceNotFoundException ex) {
                              LOG.debug("Formatter JSP not found by id, try using path.", ex);
                              if (cms.existsResource(
                                  cms.getRequestContext().removeSiteRoot(formatterConfig.getJspRootPath()))) {
                                  formatter = cms.getRequestContext().removeSiteRoot(formatterConfig.getJspRootPath());
                              }
                          }
                      } else {
                          formatter = cms.getSitePath(cms.readResource(element.getFormatterId()));
                      }
                  } catch (CmsException e) {
                      LOG.debug("Formatter resource can not be found, try reading it from the configuration.", e);
                      // the formatter resource can not be found, try reading it form the configuration
                      CmsFormatterConfiguration elementFormatters = adeConfig.getFormatters(cms, element.getResource());
                      I_CmsFormatterBean elementFormatterBean = elementFormatters.getDefaultFormatter(
                          containerType,
                          containerWidth);
                      if (elementFormatterBean == null) {
                          if (LOG.isErrorEnabled()) {
                              LOG.error(
                                  new CmsIllegalStateException(
                                      Messages.get().container(
                                          Messages.ERR_XSD_NO_TEMPLATE_FORMATTER_3,
                                          element.getSitePath(),
                                          OpenCms.getResourceManager().getResourceType(
                                              element.getResource()).getTypeName(),
                                          containerType)));
                          }
                          // skip this element, it has no formatter for this container type defined
                          return false;
                      }
                      try {
                          CmsResource formatterResource = cms.readResource(elementFormatterBean.getJspStructureId());
                          formatter = cms.getSitePath(formatterResource);
                      } catch (CmsVfsResourceNotFoundException ex) {
                          LOG.debug("Formatter JSP not found by id, try using path.", ex);
                          formatter = cms.getRequestContext().removeSiteRoot(elementFormatterBean.getJspRootPath());
                      }
                  }
  
                  printElementWrapperTagStart(cms, element, standardContext.getPage(), false);
                  standardContext.setElement(element);
                  try {
                      if (!showInContext) {
                          // write invisible dummy element
                          pageContext.getOut().print(DUMMY_ELEMENT);
                          result = false;
                      } else {
                          // execute the formatter jsp for the given element uri
                          CmsJspTagInclude.includeTagAction(
                              pageContext,
                              formatter,
                              null,
                              locale,
                              false,
                              isOnline,
                              null,
                              CmsRequestUtil.getAtrributeMap(req),
                              req,
                              res);
                      }
                  } catch (Exception e) {
                      if (LOG.isErrorEnabled()) {
                          LOG.error(
                              Messages.get().getBundle().key(
                                  Messages.ERR_CONTAINER_PAGE_ELEMENT_RENDER_ERROR_2,
                                  element.getSitePath(),
                                  formatter),
                              e);
                      }
                      printElementErrorTag(element.getSitePath(), formatter, e);
                  }
                  printElementWrapperTagEnd(false);
              }
              return result;
          }
      }