title: How to detect redirect in Spring Web Flow listener?
body: <p>I have a webapp written with the Spring Framework, Velocity, and (in part) Spring Web Flow.</p>
  
  <p>In order to provide a common set of references in all my web pages for my velocity template, I have written a FlowExecutionListener which looks like this:</p>
  
  <pre><code>@Override
  public void requestSubmitted(RequestContext context)
  {
   Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
   populateModel(model);
   context.getRequestScope().putAll(new LocalAttributeMap(model));
  }
  </code></pre>
  
  <p>I can then access the keys stored in the model as Velocity references, e.g. <code>$reference</code>.
  In general, this works great. </p>
  
  <p>However, certain exit points from the flow will redirect to a GET request, like so:</p>
  
  <pre><code>&lt;view-state id="startOver" view="redirect:/new"/&gt;
  </code></pre>
  
  <p>These redirects will do a 302 to a new request, with all the request attributes turned into URL parameters, resulting in a big unwieldy URL instead of the clean <code>/new</code> url I was trying to redirect to.</p>
  
  <p>I would like to detect in the listener when the flow is returning a redirect, so that I can skip the storing of the strings in the request attributes.  (I do this with an interceptor with standard Spring MVC by matching whether the view name starts with "redirect:" ).  But I can't seem to find a way in the listener to detect this.</p>
  
  <p>Alternately, are there other ways to prevent the request attributes from being put on the URL after a redirect?</p>