runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/StaticFileFilter.java [181:231]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private boolean maybeServeWelcomeFile(String path,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
      throws IOException, ServletException {
    if (welcomeFiles == null) {
      return false;
    }

    // Add a slash for matching purposes.  If we needed this slash, we
    // are not doing an include, and we're not going to redirect
    // somewhere else we'll redirect the user to add it later.
    if (!path.endsWith("/")) {
      path += "/";
    }

    // First search for static welcome files.
    for (String welcomeName : welcomeFiles) {
      final String welcomePath = path + welcomeName;

      Resource welcomeFile = getResource(path + welcomeName);
      if (welcomeFile != null && welcomeFile.exists()) {
        if (appEngineWebXml.includesStatic(resourceRoot + welcomePath)) {
          // In production, we optimize this case by routing requests
          // for static welcome files directly to the static file
          // (without a redirect).  This logic is here to emulate that
          // case.
          //
          // Note that we want to forward to *our* default servlet,
          // even if the default servlet for this webapp has been
          // overridden.
          RequestDispatcher dispatcher = servletContext.getNamedDispatcher("_ah_default");
          // We need to pass in the new path so it doesn't try to do
          // its own (dynamic) welcome path logic.
          request = new HttpServletRequestWrapper(request) {
              @Override
              public String getServletPath() {
                return welcomePath;
              }

              @Override
              public String getPathInfo() {
                return "";
              }
          };
          return staticFileUtils.serveWelcomeFileAsForward(dispatcher, false, request, response);
        }
      }
    }

    return false;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/StaticFileFilter.java [179:229]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private boolean maybeServeWelcomeFile(String path,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
      throws IOException, ServletException {
    if (welcomeFiles == null) {
      return false;
    }

    // Add a slash for matching purposes.  If we needed this slash, we
    // are not doing an include, and we're not going to redirect
    // somewhere else we'll redirect the user to add it later.
    if (!path.endsWith("/")) {
      path += "/";
    }

    // First search for static welcome files.
    for (String welcomeName : welcomeFiles) {
      final String welcomePath = path + welcomeName;

      Resource welcomeFile = getResource(path + welcomeName);
      if (welcomeFile != null && welcomeFile.exists()) {
        if (appEngineWebXml.includesStatic(resourceRoot + welcomePath)) {
          // In production, we optimize this case by routing requests
          // for static welcome files directly to the static file
          // (without a redirect).  This logic is here to emulate that
          // case.
          //
          // Note that we want to forward to *our* default servlet,
          // even if the default servlet for this webapp has been
          // overridden.
          RequestDispatcher dispatcher = servletContext.getNamedDispatcher("_ah_default");
          // We need to pass in the new path so it doesn't try to do
          // its own (dynamic) welcome path logic.
          request = new HttpServletRequestWrapper(request) {
              @Override
              public String getServletPath() {
                return welcomePath;
              }

              @Override
              public String getPathInfo() {
                return "";
              }
          };
          return staticFileUtils.serveWelcomeFileAsForward(dispatcher, false, request, response);
        }
      }
    }

    return false;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



