Examples of ResponseStatus


Examples of org.springframework.web.bind.annotation.ResponseStatus

  @SuppressWarnings("unchecked")
  private ModelAndView getModelAndView(Method handlerMethod, Object returnValue, ServletWebRequest webRequest)
      throws Exception {

    ResponseStatus responseStatus = AnnotationUtils.findAnnotation(handlerMethod, ResponseStatus.class);
    if (responseStatus != null) {
      HttpServletResponse response = webRequest.getResponse();
      response.setStatus(responseStatus.value().value());
    }
    if (returnValue instanceof ModelAndView) {
      return (ModelAndView) returnValue;
    }
    else if (returnValue instanceof Model) {
View Full Code Here

Examples of org.springframework.web.bind.annotation.ResponseStatus

  @Override
  protected ModelAndView doResolveException(HttpServletRequest request,
      HttpServletResponse response,
      Object handler,
      Exception ex) {
    ResponseStatus responseStatus = AnnotationUtils.findAnnotation(ex.getClass(), ResponseStatus.class);
    if (responseStatus != null) {
      try {
        return resolveResponseStatus(responseStatus, request, response, handler, ex);
      }
      catch (Exception resolveEx) {
View Full Code Here

Examples of org.springframework.web.bind.annotation.ResponseStatus

        LOG.log(status == HttpStatus.INTERNAL_SERVER_ERROR ? Level.WARNING : Level.FINE, e.getMessage(), e);
        return IO.error(new JSONObj(), e );
    }

    HttpStatus status(Exception e) {
        ResponseStatus status = e.getClass().getAnnotation(ResponseStatus.class);
        return status != null ? status.value() : HttpStatus.INTERNAL_SERVER_ERROR;
    }
View Full Code Here

Examples of org.wymiwyg.wrhapi.ResponseStatus

  /* (non-Javadoc)
   * @see org.wymiwyg.rwcf.ExceptionHandler#handleException(org.wymiwyg.rwcf.HandlerException, org.wymiwyg.rwcf.Request, org.wymiwyg.rwcf.Response)
   */
  public void handleException(Exception exception, Request request, Response response) throws HandlerException {
    ResponseStatus status;
    if (exception instanceof HandlerException) {
      status = ((HandlerException)exception).getStatus();
    } else {
      status = ResponseStatus.INTERNAL_SERVER_ERROR;
    }
    if (status.equals(ResponseStatus.INTERNAL_SERVER_ERROR)) {
      log.error("Internal Server Error", exception);
    } else {
      log.info("Exception handling request", exception);
    }
    response.setResponseStatus(status);
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.