title: Grails: Invoking Domain method from gsp
body: <p>I have the following domain class:</p>
  
  <pre><code>package com.example
  
  class Location {
     String state
  
      def getStatesList(){
  
      def states = ['AL','AK','AZ','AR','CA','CO','CT',
           'DC','DE','FL','GA','HI','ID','IL','IN','IA',
           'KS','KY','LA','ME','MD','MA','MI','MN','MS',
           'MO','MT','NE','NV','NH','NJ','NM','NY','NC',
           'ND','OH','OK','OR','PA','RI','SC','SD','TN',
           'TX','UT','VT','VA','WA','WV','WI','WY']
      return states
     }
  } 
  </code></pre>
  
  <p>In my gsp, I am trying to display the state list in a select dropdown as such</p>
  
  <pre><code>&lt;g:select name="location.state" class="form-control" from="${com.example.Location?.getStatesList()}" value="${itemInstance?.location?.state}" noSelection="['': '']" /&gt;
  </code></pre>
  
  <p>In doing so, I am receiving "missing method exception"</p>
  
  <p>If I change the method with list, I no longer receive the error, but I don't want that.</p>
  
  <pre><code>from="${com.example.Location?.list()}"    // works
  from="${com.example.Location?.getStatesList()}"     // does not work
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>