Result { public Result redirect(String url) { status(Result.SC_303_SEE_OTHER); addHeader(Result.LOCATION, url); return this; } Result(int statusCode); Object getRenderable(); Result render(Object object); Result render(Map<String, Object> mapToRender); Result render(Entry<String, Object> entry); Result render(Renderable renderable); Result render(String key, Object value); @Deprecated Result renderRaw(final String string); Result renderRaw(final byte [] bytes); String getContentType(); String getCharset(); Result charset(String charset); @Deprecated Result setContentType(String contentType); Result contentType(String contentType); Result supportedContentType(String contentTypeSupportedByThisResult); Result supportedContentTypes(String ... contentTypesSupportedByThisResult); List<String> supportedContentTypes(); Optional<String> fallbackContentType(); Result fallbackContentType(String fallbackContentType); Map<String, String> getHeaders(); Result addHeader(String headerName, String headerContent); Cookie getCookie(String cookieName); List<Cookie> getCookies(); Result addCookie(Cookie cookie); Result unsetCookie(String name); int getStatusCode(); Result status(int statusCode); String getTemplate(); Result template(String template); Class<?> getJsonView(); Result jsonView(Class<?> jsonView); Result redirect(String url); Result redirectTemporary(String url); Result html(); Result json(); Result jsonp(); Result text(); Result xml(); Result doNotCacheContent(); static final int SC_101_SWITCHING_PROTOCOLS; static final int SC_200_OK; static final int SC_201_CREATED; static final int SC_204_NO_CONTENT; static final int SC_300_MULTIPLE_CHOICES; static final int SC_301_MOVED_PERMANENTLY; static final int SC_302_FOUND; static final int SC_303_SEE_OTHER; static final int SC_304_NOT_MODIFIED; static final int SC_307_TEMPORARY_REDIRECT; static final int SC_400_BAD_REQUEST; static final int SC_401_UNAUTHORIZED; static final int SC_403_FORBIDDEN; static final int SC_404_NOT_FOUND; static final int SC_500_INTERNAL_SERVER_ERROR; static final int SC_501_NOT_IMPLEMENTED; static final String TEXT_HTML; static final String TEXT_PLAIN; static final String APPLICATION_JSON; @Deprecated
    static final String APPLICATON_JSON; static final String APPLICATION_JSONP; @Deprecated
    static final String APPLICATON_JSONP; static final String APPLICATION_XML; static final String APPLICATION_OCTET_STREAM; static final NoHttpBody NO_HTTP_BODY; static final String LOCATION; static final String CACHE_CONTROL; static final String CACHE_CONTROL_DEFAULT_NOCACHE_VALUE; static final String DATE; static final String EXPIRES; static final String WWW_AUTHENTICATE; }
@Test public void testRedirect() { Result result = new Result(Result.SC_200_OK); result.redirect("http: assertEquals(1, result.getHeaders().size()); assertEquals("http: assertEquals(Result.SC_303_SEE_OTHER, result.getStatusCode()); }