private void onError ( final int sc , final String msg ) { LOG . debug ( "Error detected with code: {} and message: {}" , sc , msg ) ; final OutputStream emptyStream = new ByteArrayOutputStream ( ) ; printWriter = new PrintWriter ( emptyStream ) ; servletOutputStream = new DelegatingServletOutputStream ( emptyStream ) ; }
Use an empty stream to avoid container writing unwanted message when a resource is missing .