title: Override Getter in Controller
body: <p>I don't appear to be able to override a getter within my grails controller.  The sample code I've created to illustrate this is provided below:</p>
  
  <pre><code>class MyController extends RestfulController&lt;MyDomainObj&gt; {
  
      def field
      def getField(){
          field += 1
      }
  
      def index(MyCommand command) {
          field = 1
          // in a controller this prints 1, but in my class it prints 2
          println('field' + field)  
      }
  }
  </code></pre>
  
  <p>If I create a Groovy class and override the getter then it works.  </p>
  
  <pre><code>class X {
  
      public static void main(String[] args){
          def x = new X()
          x.field = 1
          println x.field
      }
  
      def field
      def getField(){
          field += 1
      }
  }
  </code></pre>
  
  <p>Am I doing something wrong in the Controller or is this feature not supported in controllers?  If it isn't supported, then does anyone know why?  What magic is going on that would cause this feature not to work?</p>