Examples of sendError()


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

  }

  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException {
    if (response instanceof HttpServletResponse) {
      HttpServletResponse httpResponse = (HttpServletResponse) response;
      httpResponse.sendError(404);
    }
  }

}
View Full Code Here

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

            log.error("Network Places Request Failed: " + req.getPathInfo(), ex);
            BundleActionMessage bam = ex.getBundleActionMessage();
            MessageResources mr = CoreUtil.getMessageResources(req.getSession(), bam.getBundle());
            // TODO locale
            String val = mr == null ? null : mr.getMessage(bam.getKey());
            res.sendError(DAVStatus.SC_INTERNAL_SERVER_ERROR, val == null ? (ex.getMessage() == null ? "No message supplied." : ex
                            .getMessage()) : val);
        } catch (DAVException ex) {
            res.setStatus(ex.getStatus());
        } catch (LockedException ex) {
            res.sendError(DAVStatus.SC_LOCKED, ex.getMessage());
View Full Code Here

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

            res.sendError(DAVStatus.SC_INTERNAL_SERVER_ERROR, val == null ? (ex.getMessage() == null ? "No message supplied." : ex
                            .getMessage()) : val);
        } catch (DAVException ex) {
            res.setStatus(ex.getStatus());
        } catch (LockedException ex) {
            res.sendError(DAVStatus.SC_LOCKED, ex.getMessage());
        } catch (Throwable t) {
            log.error("Network Places Request Failed: " + req.getPathInfo(), t);
            res.sendError(DAVStatus.SC_INTERNAL_SERVER_ERROR, t.getMessage() == null ? "<null>" : t.getMessage());
        } finally {
            if (transaction != null && transaction.getSessionInfo() != null && transaction.getSessionInfo().isTemporary()) {
View Full Code Here

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

            res.setStatus(ex.getStatus());
        } catch (LockedException ex) {
            res.sendError(DAVStatus.SC_LOCKED, ex.getMessage());
        } catch (Throwable t) {
            log.error("Network Places Request Failed: " + req.getPathInfo(), t);
            res.sendError(DAVStatus.SC_INTERNAL_SERVER_ERROR, t.getMessage() == null ? "<null>" : t.getMessage());
        } finally {
            if (transaction != null && transaction.getSessionInfo() != null && transaction.getSessionInfo().isTemporary()) {
                transaction.getSessionInfo().getHttpSession().invalidate();
            }
        }
View Full Code Here

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

            String url = request.getRequestURL()
                         .append(request.getQueryString() != null ? "?"+request.getQueryString() : "")
                         .toString();
            // TODO: The url is clean, at least in Tomcat, which strips out the JSESSIONID path parameter automatically (Jetty does not?!)
            response.setHeader("Location", url);
            response.sendError(HttpServletResponse.SC_MOVED_PERMANENTLY);
            return;
        }

        // Prevent rendering of JSESSIONID in URLs for all outgoing links
        HttpServletResponseWrapper wrappedResponse =
View Full Code Here

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

    if (command.indexOf(';') != -1)
      command = command.substring(0, command.indexOf(';') - 1);
       
    if (!isJmxEnabled())
    {
      response.sendError(503 ,"JMX is not enabled, unable to use cipango console. Please start Cipango with:\n" +
      "\tjava -jar start.jar --ini=start-cipango.ini --pre=etc/cipango-jmx.xml");
      return;
    }
   
    Principal principal = request.getUserPrincipal();
View Full Code Here

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

    HttpServletResponse res = (HttpServletResponse) response;

    if (_exception != null)
      throw _exception;
    else if (_errorCode != 0)
      res.sendError(_errorCode, null);
    else
      res.sendError(500, "configuration error");
  }
}
View Full Code Here

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

    if (_exception != null)
      throw _exception;
    else if (_errorCode != 0)
      res.sendError(_errorCode, null);
    else
      res.sendError(500, "configuration error");
  }
}
View Full Code Here

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

      if (cauchoReq == null || cauchoReq.getRequestDepth(0) != 0) {
      }
      else if (relPath.regionMatches(true, 0, "/web-inf", 0, 8)
               && (relPath.length() == 8
                   || ! Character.isLetterOrDigit(relPath.charAt(8)))) {
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
        return;
      }
      else if (relPath.regionMatches(true, 0, "/meta-inf", 0, 9)
               && (relPath.length() == 9
                   || ! Character.isLetterOrDigit(relPath.charAt(9)))) {
View Full Code Here

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

        return;
      }
      else if (relPath.regionMatches(true, 0, "/meta-inf", 0, 9)
               && (relPath.length() == 9
                   || ! Character.isLetterOrDigit(relPath.charAt(9)))) {
        res.sendError(HttpServletResponse.SC_NOT_FOUND);
        return;
      }

      if (relPath.endsWith(".DS_store")) {
        // MacOS-X security hole with trailing '.'
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.