@Test(expected = ResultException.class) public void shouldThrowResultExceptionIfIOExceptionOccursWhileRedirect() throws Exception { doThrow(new IOException()).when(response).sendRedirect(anyString()); view.redirectTo("/any/url"); }
public void redirectTo(String url) { logger.debug("redirection to {}", url); try { if (url.startsWith("/")) { response.sendRedirect(request.getContextPath() + url); } else { response.sendRedirect(url); } } catch (IOException e) { throw new ResultException(e); } }
DefaultPageResult implements PageResult { public void redirectTo(String url) { logger.debug("redirection to {}", url); try { if (url.startsWith("/")) { response.sendRedirect(request.getContextPath() + url); } else { response.sendRedirect(url); } } catch (IOException e) { throw new ResultException(e); } } }
DefaultPageResult implements PageResult { public void redirectTo(String url) { logger.debug("redirection to {}", url); try { if (url.startsWith("/")) { response.sendRedirect(request.getContextPath() + url); } else { response.sendRedirect(url); } } catch (IOException e) { throw new ResultException(e); } } @Inject  DefaultPageResult(MutableRequest req, MutableResponse res, MethodInfo requestInfo,
			PathResolver resolver, Proxifier proxifier); }
DefaultPageResult implements PageResult { public void redirectTo(String url) { logger.debug("redirection to {}", url); try { if (url.startsWith("/")) { response.sendRedirect(request.getContextPath() + url); } else { response.sendRedirect(url); } } catch (IOException e) { throw new ResultException(e); } } @Inject  DefaultPageResult(MutableRequest req, MutableResponse res, MethodInfo requestInfo,
			PathResolver resolver, Proxifier proxifier); void defaultView(); void include(); void redirectTo(String url); void forwardTo(String url); T of(final Class<T> controllerType); void redirect(String url); void forward(String url); void forward(); }
DefaultPageResult implements PageResult { public void redirectTo(String url) { logger.debug("redirection to {}", url); try { if (url.startsWith("/")) { response.sendRedirect(request.getContextPath() + url); } else { response.sendRedirect(url); } } catch (IOException e) { throw new ResultException(e); } } @Inject  DefaultPageResult(MutableRequest req, MutableResponse res, MethodInfo requestInfo,
			PathResolver resolver, Proxifier proxifier); void defaultView(); void include(); void redirectTo(String url); void forwardTo(String url); T of(final Class<T> controllerType); void redirect(String url); void forward(String url); void forward();  }