Buggy code:
public class RedirectView extends AbstractUrlBasedView { private boolean contextRelative = false ; private boolean http10Compatible = true ; private boolean exposeModelAttributes = true ; private String encodingScheme ; private HttpStatus statusCode ; public RedirectView ( ) { } public RedirectView ( String url ) { } public RedirectView ( String url , boolean contextRelative ) { } public RedirectView ( String url , boolean contextRelative , boolean http10Compatible ) { } public RedirectView ( String url , boolean contextRelative , boolean http10Compatible , boolean exposeModelAttributes ) { } public void setContextRelative ( boolean contextRelative ) { } public void setHttp10Compatible ( boolean http10Compatible ) { } public void setExposeModelAttributes ( final boolean exposeModelAttributes ) { } public void setEncodingScheme ( String encodingScheme ) { } public void setStatusCode ( HttpStatus statusCode ) { } @ Override protected void renderMergedOutputModel ( Map < String , Object > model , HttpServletRequest request , HttpServletResponse response ) throws IOException { } protected final String createTargetUrl ( Map < String , Object > model , HttpServletRequest request ) throws UnsupportedEncodingException { StringBuilder targetUrl = new StringBuilder ( ) ; if ( ( this . contextRelative ) && ( getUrl ( ) . startsWith ( "//" ) ) ) { targetUrl . append ( request . getContextPath ( ) ) ; } targetUrl . append ( getUrl ( ) ) ; String enc = this . encodingScheme ; if ( enc == null ) { enc = request . getCharacterEncoding ( ) ; } if ( enc == null ) { enc = WebUtils . DEFAULT_CHARACTER_ENCODING ; } UriTemplate uriTemplate = createUriTemplate ( targetUrl , enc ) ; if ( ( uriTemplate . getVariableNames ( ) . size ( ) ) > 0 ) { Map < String , Object > vars = new HashMap < String , Object > ( ) ; vars . putAll ( getCurrentUriVars ( request ) ) ; vars . putAll ( model ) ; targetUrl = new StringBuilder ( uriTemplate . expand ( vars ) . toString ( ) ) ; model = RedirectView . removeKeys ( model , uriTemplate . getVariableNames ( ) ) ; } FlashMap flashMap = RequestContextUtils . getFlashMap ( request ) ; if ( ! ( CollectionUtils . isEmpty ( flashMap ) ) ) { <START_BUG> flashMap . setExpectedUrlPath ( request , targetUrl . toString ( ) ) ; <END_BUG> } if ( this . exposeModelAttributes ) { appendQueryProperties ( targetUrl , model , enc ) ; if ( ! ( CollectionUtils . isEmpty ( flashMap ) ) ) { flashMap . setExpectedRequestParams ( model ) ; } } return targetUrl . toString ( ) ; } @ SuppressWarnings ( "unchecked" ) private Map < String , String > getCurrentUriVars ( HttpServletRequest request ) { } @ SuppressWarnings ( "serial" ) private UriTemplate createUriTemplate ( StringBuilder targetUrl , final String encoding ) { } private static Map < String , Object > removeKeys ( Map < String , Object > map , List < String > keysToRemove ) { } protected void appendQueryProperties ( StringBuilder targetUrl , Map < String , Object > model , String encodingScheme ) throws UnsupportedEncodingException { } protected Map < String , Object > queryProperties ( Map < String , Object > model ) { } protected boolean isEligibleProperty ( String key , Object value ) { } protected boolean isEligibleValue ( Object value ) { } protected String urlEncode ( String input , String encodingScheme ) throws UnsupportedEncodingException { } protected void sendRedirect ( HttpServletRequest request , HttpServletResponse response , String targetUrl , boolean http10Compatible ) throws IOException { } protected HttpStatus getHttp11StatusCode ( HttpServletRequest request , HttpServletResponse response , String targetUrl ) { } }

Fix:
flashMap . setExpectedRequestUri ( request , targetUrl . toString ( ) ) ;