Using flash attributes when redirecting to a JSP page
<p>I have the following situation in my MVC controller</p>

<pre><code>    for (String key : form.keySet())
        redirectAttrs.addFlashAttribute(key, form.getFirst(key));

    return "redirect:" + page;
</code></pre>

<p><code>page</code> is <code>/secure/admin/pages/userPreferences.jsp</code> and I have a single <code>username</code> attribute added to the flash attributes</p>

<p>From the JSP page, how do I access that <code>username</code> flash attributes. But I have no idea of how!</p>

<p>I have tried both <code>${param.username}</code> and <code>${username}</code> but none worked. I tried to dump all <code>${param}</code> and request attributes but found nothing in the JSP</p>

<p>Similar question: <a href="https://stackoverflow.com/questions/11763779/how-to-read-flash-attributes-after-redirection-in-spring-mvc-3-1">How to read flash attributes after redirection in Spring MVC 3.1?</a> - the difference is that <em>they</em> want to read flash attributes from MVC controller rather than from JSP view</p>