title: Passing map from controller
body: <p>I am trying to pass a map that is being created from specific values that have been clicked on and send it to my view page so that it will populate my table with the specific days from the choices I made. But no matter what I do it will not pass my map into the controller. I send a query to retrieve the values for my controller and then place it into a map to then send it to my view page through <code>[finalMap: finalMap]</code> but it does not allow me to call it in my view page. </p>
  
  <p>Here is the function in my controller handling the results from the query and placing them into a map:</p>
  
  <pre><code>    def testFunction = {
  
      def days = Utility.executeQuery("select date from Utility where week_id = ${params.utility.week_id}")
  
      def testMap = days
      def map = testMap.collect{[it, it]}
      def finalMap = map.listIterator().reverse().collectEntries()
  
      [finalMap: finalMap]
      }
  </code></pre>
  
  <p>Even though I have it in a map it cannot call it from my view page as seen here:</p>
  
  <pre><code>    &lt;table id="mondayTimeSelection" border width = 450 height=200&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;g:each in="${finalMap}" var="e"&gt;&lt;th style="text-align: center; width: 115px;"&gt;${e.key}&lt;/th&gt;&lt;/g:each&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>How can I pass this map to my controller successfully from my function in my controller? Or is there another way I should be going about this?</p>