code: public void displayValidation(String entityId, CmsValidationResult validationResult) {
  
          if (m_formTabPanel != null) {
              CmsAttributeHandler.clearErrorStyles(m_formTabPanel);
          }
          m_rootHandler.visit(CmsValidationHandler::clearValidation);
          if (validationResult.hasWarnings(entityId)) {
              for (Entry<String[], String> warning : validationResult.getWarnings(entityId).entrySet()) {
                  String[] pathElements = warning.getKey();
                  // check if there are no errors for this attribute
                  if (!validationResult.hasErrors(entityId)
                      || !validationResult.getErrors(entityId).containsKey(pathElements)) {
                      CmsAttributeHandler handler = m_rootHandler.getHandlerByPath(pathElements);
                      if (handler != null) {
                          String attributeName = pathElements[pathElements.length - 1];
                          handler.setWarningMessage(
                              CmsContentDefinition.extractIndex(attributeName),
                              warning.getValue(),
                              m_formTabPanel);
                      }
                  }
              }
          }
          if (validationResult.hasErrors(entityId)) {
              for (Entry<String[], String> error : validationResult.getErrors(entityId).entrySet()) {
                  String[] pathElements = error.getKey();
                  CmsAttributeHandler handler = m_rootHandler.getHandlerByPath(pathElements);
                  if (handler != null) {
                      String attributeName = pathElements[pathElements.length - 1];
                      handler.setErrorMessage(
                          CmsContentDefinition.extractIndex(attributeName),
                          error.getValue(),
                          m_formTabPanel);
                  }
              }
              m_validationContext.addInvalidEntity(entityId);
          } else {
              m_validationContext.addValidEntity(entityId);
          }
          ValueChangeEvent.fire(this, m_validationContext);
          m_validating = false;
      }
docs: Displays the given error messages within the form.<p>
  
  @param entityId the entity id
  @param validationResult the validationResult