docs: public RequestDispatcher getErrorPageDispatcher(ServletRequest req, ServletErrorReport ser) {
  
          if (this.getDestroyed().booleanValue()) { // should be a fast boolean check.
              throw new MajorHandlingRuntimeException("WebContainer can not handle the request");
          }
  
          String methodName = "getErrorPageDispatcher";
  
          // Get and Set error request attributes.
          Integer errorCode = new Integer(ser.getErrorCode());
          Class errorException = ser.getExceptionClass();
          String errorMessage = ser.getMessage();
          
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Looking for defined Error Page!");
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Exception errorCode=" + errorCode);
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Exception type=" + errorException);
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Exception message=" + errorMessage);
          }
  
          // 114582 - begin - get down to the root servlet exception
          ServletException sx = (ServletException) ser;
          Throwable th = sx.getRootCause();
  
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Servlet Exception is: " + sx);
              logger.logp(Level.FINE, CLASS_NAME, methodName, "th (root cause) is: " + th);
          }
  
          // Defect 114582 - walk upwards to the root servlet exception.
  
          // Defect 114582 - test against ServletException if preV7; otherwise, test against ServletErrorReport.
  
          boolean isPreV7 =
              ((WCCustomProperties.ERROR_PAGE_COMPATIBILITY != null) &&
               WCCustomProperties.ERROR_PAGE_COMPATIBILITY.equalsIgnoreCase("V6"));
          
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
              logger.logp(Level.FINE, CLASS_NAME, methodName, (isPreV7 ? "is PreV7" : "not PreV7"));
          }        
  
          // Walk upwards while there is another servlet exception and a new root cause.
  
          // Defect 155880 - Don't shift upwards if the root cause is null.
  
          if (isPreV7) {
              while (th != null && th instanceof ServletException && ((ServletException) th).getRootCause() != null) { // defect
                  sx = (ServletException) th;
                  th = sx.getRootCause();
                  
                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                      logger.logp(Level.FINE, CLASS_NAME, methodName, "unwrapping exceptions Servlet Exception is now: " + sx);
                      logger.logp(Level.FINE, CLASS_NAME, methodName, "th (root cause) is now: " + th);
                  }                
              }
  
          } else {
              while (th != null && th instanceof ServletErrorReport && ((ServletErrorReport) th).getRootCause() != null) {
                  sx = (ServletException) th;
                  th = sx.getRootCause();
  
                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                      logger.logp(Level.FINE, CLASS_NAME, methodName, "unwrapping exceptions Servlet Exception is now: " + sx);
                      logger.logp(Level.FINE, CLASS_NAME, methodName, "th (root cause) is now: " + th);
                  }
                  
              }
          }
  
          // 114582 - only set exception type if root exception is not null
          if (th != null) {
              req.setAttribute("javax.servlet.error.exception", th);
              if (errorException != null) {
                  req.setAttribute("javax.servlet.error.exception_type", errorException);
              }
          }
          
          if (errorMessage != null) {
              req.setAttribute("javax.servlet.error.message", errorMessage);
          }
  
  
          // add the request uri to the request object
          HttpServletRequest httpServletReq = (HttpServletRequest) ServletUtil.unwrapRequest(req, HttpServletRequest.class);
          req.setAttribute("javax.servlet.error.request_uri", httpServletReq.getRequestURI());
  
          WebContainerRequestState.getInstance(true).setAttribute("isErrorDispatcherType", "true");
  
          // add the target servlet name to the request object
          if (ser.getTargetServletName() != null) {
              req.setAttribute("javax.servlet.error.servlet_name", ser.getTargetServletName());
          } else {
              IExtendedRequest wsRequest = (IExtendedRequest) ServletUtil.unwrapRequest(req);
              WebAppDispatcherContext ctxt = (WebAppDispatcherContext) wsRequest.getWebAppDispatcherContext();
              RequestProcessor processor = ctxt.getCurrentServletReference();
              if (processor != null) {
                  String name = processor.getName();
                  req.setAttribute("javax.servlet.error.servlet_name", name);
              }
          }
  
          // LIDB1234.5 - end
  
          // Arguably, the request attributes are unnecessary if the configuration is unavailable,
          // meaning, the exception maybe could be thrown at the beginning of this method.
  
          if (config==null) { //if the application was stopped then config will be null.  It's possible that a previous request could have made it here and thrown an exception 
              throw new MajorHandlingRuntimeException("WebContainer can not handle the request", sx);
          }
  
          // Look for an error page which matches by error-code or exception-type, then
          // look for a default error page.
                  
          String errorURL = null;
          Object errorSelector = null;
          String errorURLCase = null;
  
          // START PK55149:
          //
          // If custom property "com.ibm.wsspi.webcontainer.WCCustomProperties.ERROR_EXCEPTION_TYPE_FIRST" is
          // enabled, lookup by exception type then by error code.
          //
          // Default to lookup by error code then by error code.
          
          // Maybe lookup the error-code first ...
          if (!errorExceptionTypeFirst) {
              ErrorPage errorPage = config.getErrorPageByErrorCode(errorCode);
  
              if (errorPage != null) {
                  errorURL = errorPage.getLocation();
                  if ((errorURL != null)) { // Should not be null or empty, but check, just in case.                
                      if (errorURL.length() > 0) {
                          errorSelector = errorCode;
                          errorURLCase = "error-code";
                      } else {
                          errorURL = null;
                      }
                  }
              }            
          }
          
          // Either, the error-code lookup was first, but failed,
          // or the exception-type lookup is first.       
          if (errorURL == null) {
              if (th != null) {
                  ErrorPage errorPage;                
                  if (isPreV7) {
                      errorPage = config.getErrorPageByExceptionType(th);
                  } else {
                      errorPage = config.getErrorPageTraverseRootCause(th);
                  }
  
                  if (errorPage != null) {
                      errorURL = errorPage.getLocation();
                      if ((errorURL != null)) { // Should not be null or empty, but check, just in case.
                          if (errorURL.length() > 0) {
                              errorSelector = errorCode;
                              errorURLCase = "exception-type";
                          } else {
                              errorURL = null;
                          }
                      }
                  }
              }
          }
  
          // .. or lookup by error-code second.
          if (errorExceptionTypeFirst && (errorURL == null)) {
              ErrorPage errorPage = config.getErrorPageByErrorCode(errorCode);
              
              if (errorPage != null) {
                  errorURL = errorPage.getLocation();
                  if ((errorURL != null)) {  // Should not be null or empty, but check, just in case.
                      if (errorURL.length() > 0) {
                          errorSelector = errorCode;
                          errorURLCase = "error-code";
                      } else {
                          errorURL = null;
                      }
                  }
              }
          }
          
          // END PK55149
  
          // If no error page matching the specific error code or exception type was
          // obtained, then, if configured, use the default error page.  A default
          // error page will be obtained from the web.xml or web-fragment.xml as
          // an error page with no error code and no exception type, or will be
          // obtained from the ibm-web-ext.xml as an expliclit value.
          
          // But, don't use a default error page for error code 403.
          // Error code 403 is a security error code:
          // "Error 403--Forbidden when trying to access the servlet".
          
          if (errorURL == null) {            
              if (errorCode.intValue() == 403) {
                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                      logger.logp(Level.FINE, CLASS_NAME, methodName, "No match on error-code or exception-type; code 403 prevents default error page");
                  }
                  return null;
              }
              
              errorURL = config.getDefaultErrorPage();
              if (errorURL != null) {
                  // Should no be empty, but check, just in case.            
                  if (errorURL.length() > 0) {
                      errorSelector = "DEFAULT";
                      errorURLCase = "default";
                  } else {
                      errorURL = null;
                  }
              }
          }
  
          if (errorURL == null) {
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                  logger.logp(Level.FINE, CLASS_NAME, methodName, "No match on error-code or exception-type; no default error page");
              }            
              return null;
          }
  
          // Prior logging put this out before forcing the initial "/"; keep to that pattern.
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
              logger.logp(Level.FINE, CLASS_NAME, methodName, "Found " + errorURLCase + "=" + errorSelector + " with location=" + errorURL);
          }
  
          if (!errorURL.startsWith("/")) {
              errorURL = "/" + errorURL;
          }
  
          // WebAppDispatcherContext dispatchContext = new
          // WebAppDispatcherContext(this);
          // dispatchContext.setRelativeUri(errorURL);
  
          return getRequestDispatcher(errorURL);
      }