protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String servletPath;
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) {