title: Grails 3.0.11 AOP annotation to preprocess commandObjects before Controller methods
body: <p>I am trying to retrieve the arguments of a grails controller method using an annotation and an Aspect that executes before the method. 
  The aspect handler executes correctly but i cant access the argument(which implements <code>grails.validation.Validateable</code>) the list of arguments is empty.</p>
  
  <p><em>experiment.aspect.validated</em></p>
  
  <pre><code>package experiment.aspect
  
  import java.lang.annotation.ElementType
  import java.lang.annotation.Retention
  import java.lang.annotation.RetentionPolicy
  import java.lang.annotation.Target
  
  /**
   * Created by Vaggelis on 10/13/2016.
   */
  
  @Target(ElementType.METHOD)
  @Retention(RetentionPolicy.RUNTIME)
  @interface Validated {
  
  }
  </code></pre>
  
  <p><em>experiment.aspect.ValidatedAspect</em></p>
  
  <pre><code>package experiment.aspect
  
  
  import grails.validation.ValidationException
  import org.aspectj.lang.JoinPoint
  
  import org.aspectj.lang.annotation.Aspect
  import org.aspectj.lang.annotation.Before
  
  
  /**
   * Created by Vaggelis on 10/13/2016.
   */
  @Aspect
  class ValidatedAspect {
  
      @Before("@annotation(experiment.aspect.Validated)")
      public void preValidate(JoinPoint point) throws ValidationException{
  
          println "parameters  ${point.getArgs()}"
  
  
      }
  }
  </code></pre>
  
  <p><em>conf.spring.resources</em></p>
  
  <pre><code>import experiment.aspect.ValidatedAspect
  
  // Place your Spring DSL code here
  beans = {
      validatedAspect(ValidatedAspect)
  }
  </code></pre>
  
  <p><em>controllers.experiment.TestController</em></p>
  
  <pre><code>package experiment
  import experiment.aspect.Validated
  class TestController extends BaseController {
      static responseFormats = ['json']
      @Validated
      def login(LoginCommand loginCommand){
           println "Validated"
           ...
      }
  
  }
  </code></pre>
  
  <p><em>experiment.LoginCommand</em></p>
  
  <pre><code>package experiment
  
  /**
   * Created by Vaggelis on 9/14/2016.
   */
  import grails.validation.Validateable
  
  
  class LoginCommand implements Validateable {
  //    String id
      String name
      static constraints = {
          name blank: false
      }
  }
  </code></pre>
  
  <p>I get the following output, which means that the aspect handler method runs before the controller method but it does not get the arguments.</p>
  
  <pre><code>parameters []
  Validated
  </code></pre>