Package com.google.apphosting.utils.config

Examples of com.google.apphosting.utils.config.WebXml


    String pathInfo;

    AppEngineWebXml appEngineWebXml = (AppEngineWebXml) getServletContext().getAttribute(
        "com.google.appengine.tools.development.appEngineWebXml");

    WebXml webXml = (WebXml) getServletContext().getAttribute(
        "com.google.appengine.tools.development.webXml");

    Boolean forwarded = (Boolean) request.getAttribute(Dispatcher.__FORWARD_JETTY);
    if (forwarded == null) {
      forwarded = Boolean.FALSE;
    }

    Boolean included = (Boolean) request.getAttribute(Dispatcher.__INCLUDE_JETTY);
    if (included != null && included) {
      servletPath = (String) request.getAttribute(Dispatcher.__INCLUDE_SERVLET_PATH);
      pathInfo = (String) request.getAttribute(Dispatcher.__INCLUDE_PATH_INFO);
      if (servletPath == null) {
        servletPath = request.getServletPath();
        pathInfo = request.getPathInfo();
      }
    } else {
      included = Boolean.FALSE;
      servletPath = request.getServletPath();
      pathInfo = request.getPathInfo();
    }

    String pathInContext = URIUtil.addPaths(servletPath, pathInfo);

    if (maybeServeWelcomeFile(pathInContext, included, request, response)) {
      return;
    }

    Resource resource = null;
    try {
      resource = getResource(pathInContext);

      if (resource != null && resource.isDirectory()) {
        if (included ||
            staticFileUtils.passConditionalHeaders(request, response, resource)) {
          response.sendError(HttpServletResponse.SC_FORBIDDEN);
        }
      } else {
        if (resource == null || !resource.exists()) {
          logger.warning("No file found for: " + pathInContext);
          response.sendError(HttpServletResponse.SC_NOT_FOUND);
        } else {
          boolean isStatic = appEngineWebXml.includesStatic(resourceRoot + pathInContext);
          boolean isResource = appEngineWebXml.includesResource(
              resourceRoot + pathInContext);
          boolean usesRuntime = webXml.matches(pathInContext);
          Boolean isWelcomeFile = (Boolean)
              request.getAttribute("com.google.appengine.tools.development.isWelcomeFile");
          if (isWelcomeFile == null) {
            isWelcomeFile = false;
          }
View Full Code Here

TOP

Related Classes of com.google.apphosting.utils.config.WebXml

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.