title: access-control-allow-origin on playframework
body: <p>How can I get playframework to allow non-origin calls? I have tried adding a @Before method to a controller, but that never gets called by an ajax client.</p>
  
  <pre><code>@Before 
  public static void setCORS()
  {
      Http.Response.current().accessControl("*", "GET,PUT,POST,DELETE", true);
  }
  </code></pre>
  
  <p>I am trying to setup a test API server for client developers to test against, but that seems to require disabling the Origin restriction.</p>
  
  <p>Has anyone else got this working? or accomplished this in a different way?</p>
  
  <p><strong>UPDATE:</strong>
  I found this article on the topic 
  <a href="http://javathought.wordpress.com/2011/12/04/cross-origin-resource-sharing-with-play-framework/" rel="nofollow">http://javathought.wordpress.com/2011/12/04/cross-origin-resource-sharing-with-play-framework/</a></p>