Main differences with the Spring MVC original implementation: - Default redirect HTTP code is 303 See Other since we can assume all HTTP clients support HTTP 1.1 in 2016 - No more http10Compatible property, use statusCode instead - By default the redirect is relative to the context path

@rstoyanchev Could you please review this PR to give me your feedback on the choices I made? Notice that sessionId should be correctly encoded for Servlet based engines.

Comment From: rstoyanchev

@sdeleuze overall looks good.

A few comments with hindsight in mind on an all new RedirectView. Starting with the overloaded constructors designed to be one liners in controller methods, perhaps we could replace those with a builder? Not sure if we even need the default constructor "for use as a bean" since what's typically configured in Spring configuration is the UrlBasedViewResolver.

On that note, the present Servlet-based UrlBasedViewResolver exposes all (or most?) properties that RedirectView has so that it can pass them each time it creates a RedirectView instance at runtime. At present I see only redirectStatusCode and redirectHosts on the reactive equivalent. Indeed I'm not a fan of replicating so many properties myself. Perhaps we can think of a better mechanism like a property accepting a java.util.function.Function<String, RedirectView>?

For exposeModelAttributes let's skip that part altogether including appendQueryProperties and related methods. The automatic appending of attributes to the query has been a long standing source of issues and one of two primary reasons for RedirectAttributes (flash attributes is the other). Instead we can make expandUriTemplateVariables the primary way of appending to the query on a redirect. It's simple, expressive, and explicit.

For the ServletBasedRedirectUrlEncoder this is raising a good point for SPR-14529 that the solution for URL-rewriting should probably be at the ServerHttpResponse level and allow any such underlying runtime mechanism to also be included. This is what we did for contextPath support on ServerHttpRequest. So feel free to leave this part out for now and @Ignore any tests related to it.

Comment From: sdeleuze

Merged as https://github.com/spring-projects/spring-framework/commit/2e994f7dc38b5520555720dac215064949ccfabf.