MockControl responsec = newControl(HttpServletResponse.class);
HttpServletResponse response = (HttpServletResponse) responsec.getMock();
Throwable t = new IOException("Mock IO Exception");
response.encodeRedirectURL("/");
responsec.setReturnValue("<encoded: http://foo.bar>");
response.sendRedirect("<encoded: http://foo.bar>");
responsec.setThrowable(t);