title: Optimal way of passing data from a filter to a controller?
body: <p>Hi there in part of our application i need to pass data from a filter to a controller. I have read that this can be done by using a request object and a before interceptor on the controller.</p>
  
  <p>Some example code:</p>
  
  <pre><code>class SomeService {
      def doSomething(request, params) {
          request.foo = "helloworld"
      }
  }
  
  class SomeFilter {
  
      def someService
  
      def filters = {
          all(controller:'*', action:'*') {
              before = {
                  // service does something and places object in request
                  // using request.foo = "helloworld"
                  someService.doSomething(request, params)
              }
          }
      }
  }
  
  class SomeController {
  
      def foo
  
      def beforeInterceptor = {
          foo = request.foo
      }
  
      def index = { 
          println foo
      }
  }
  </code></pre>
  
  <p>Is this an efficient way of doing things or are there other ways?</p>