We can set system output to response output - System.setOut(new PrintStream (response.getOutputStream));