title: Grails 2.5 - Is it possible to invoke different actions based on Accept header or format parameter (for the same controller)?
body: <p>I have a controller method which is currently mapped on UrlMappings like this:</p>
  
  <pre><code>"/api/objects"(controller: 'apiObject',  action: [GET: "list"], parseRequest: true)
  </code></pre>
  
  <p>Which works fine. The list action returns the JSON representation of a list of objects. </p>
  
  <p>What I'd like to do now is, on top of that, add the possibility of having that same list represented as a CSV file.</p>
  
  <p>For instance, I'd like a <code>'/api/objects'</code> call to remain to be served by <code>ApiObjectController#list</code>, and <code>'/api/objects?format=csv'</code> to be served by a different method, such as <code>ApiObjectController#renderListAsCsv</code>.</p>
  
  <p>Is it possible to do that, either by using <code>format=csv</code> param or <code>Accept</code> header?</p>
  
  <p>Thanks!</p>