Examples of sendError()


Examples of javax.servlet.http.HttpServletResponse.sendError()

        return;
      }

      if (relPath.endsWith(".DS_store")) {
        // MacOS-X security hole with trailing '.'
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
        return;
      }
      else if (! CauchoSystem.isWindows() || relPath.length() == 0) {
      }
      else if (path.isDirectory()) {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

      }
      else if (path.isDirectory()) {
      }
      else if (path.isWindowsInsecure()) {
        // Windows security issues with trailing '.'
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
        return;
      }

      // A null will cause problems.
      for (int i = relPath.length() - 1; i >= 0; i--) {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

      // A null will cause problems.
      for (int i = relPath.length() - 1; i >= 0; i--) {
        char ch = relPath.charAt(i);

        if (ch == 0) {
          res.sendError(HttpServletResponse.SC_NOT_FOUND);
          return;
        }
      }

      ServletContext webApp = getServletContext();
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

          sendRedirect(res, uri + "/");
      }
      else if (_dir != null)
        _dir.forward(req, res);
      else
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
     
      return;
    }

    if (! cache.canRead()) {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

    if (! cache.canRead()) {
      if (isInclude)
        throw new FileNotFoundException(uri);
      else
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
      return;
    }

    // server/4500, #4218
    String method = req.getMethod();
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

    // server/4500, #4218
    String method = req.getMethod();
    if (! method.equalsIgnoreCase("GET")
        && ! method.equalsIgnoreCase("HEAD")
        && ! method.equalsIgnoreCase("POST")) {
      res.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED,
                    "Method not implemented");
      return;
    }

    String ifMatch = req.getHeader("If-None-Match");
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

    String ifMatch = req.getHeader("If-None-Match");
    String etag = cache.getEtag();

    if (ifMatch != null && ifMatch.equals(etag)) {
      res.addHeader("ETag", etag);
      res.sendError(HttpServletResponse.SC_NOT_MODIFIED);
      return;
    }

    String lastModified = cache.getLastModifiedString();
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

      }

      if (! isModified) {
        if (etag != null)
          res.addHeader("ETag", etag);
        res.sendError(HttpServletResponse.SC_NOT_MODIFIED);
        return;
      }
    }

    res.addHeader("ETag", etag);
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

  {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;

    if (! _enable) {
      res.sendError(res.SC_FORBIDDEN);
      return;
    }

    if (_needsSecure && ! req.isSecure()) {
      res.sendError(res.SC_FORBIDDEN);
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendError()

      res.sendError(res.SC_FORBIDDEN);
      return;
    }

    if (_needsSecure && ! req.isSecure()) {
      res.sendError(res.SC_FORBIDDEN);
      return;
    }

    if (_role != null && ! req.isUserInRole(_role)) {
      res.sendError(res.SC_FORBIDDEN);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.