title: grails scope questions - page, request, flash
body: <p>The <a href="http://www.grails.org/doc/latest/guide/6.%20The%20Web%20Layer.html#6.2%20Groovy%20Server%20Pages" rel="nofollow">grails manual</a> shows the following example:</p>
  
  <pre><code>&lt;g:set var="now" value="${new Date()}" scope="request" /&gt;
  </code></pre>
  
  <p>and also indicates by default variables defined by the set are page scope (out of the page, request, flash, session, and application choices).  I'm wondering what the difference between page and request scope is, and what an example use of the difference might be.</p>
  
  <p>Also, with the flash scope, the manual indicates:  "Grails supports the concept of flash scope as a temporary store for attributes which need to be available for this request and the next request only. Afterwards the attributes are cleared. This is useful for setting a message directly before redirection."</p>
  
  <p>It isn't immediately apparent to me how redirection relates to "this request and the next request", since the example of redirection they give is redirecting from one controller action to another, which doesn't respond in two pages/http responses being sent to the client?</p>
  
  <p>Hopefully those two questions make sense -- i.e. high level difference between page and request scope, and how redirecting between actions is useful for flash scope?</p>