public static ModelAndView writeError ( final HttpServletResponse response , final String error ) { val model = CollectionUtils . wrap ( OAuth20Constants . ERROR , error ) ; val mv = new ModelAndView ( new MappingJackson2JsonView ( MAPPER ) , ( Map ) model ) ; mv . setStatus ( HttpStatus . BAD_REQUEST ) ; response . setStatus ( HttpStatus . BAD_REQUEST . value ( ) ) ; return mv ; }
Write to the output this error .