title: Enabling CORS on JBoss server without using servlet
body: <p>I am using <em>jboss-as-7.1.1.Final</em> I want to enable <strong>CORS on JBoss server</strong> as the request is coming form Extjs/javascript which is deployed on one domain (i.e abc.xxx, which is jboss server) Ajax request is send to second domain (i.e xyz.xxx, which is jboss server) i am using ajax as i need to pass custom headers to the URL and i facing issue where the error saying</p>
  
  <p>"XMLHttpRequest cannot load <strong><em>xyz.xxx/XXX</em></strong>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin <strong><em>'abc.xxx'</em></strong> is therefore not allowed access. "</p>
  
  <p>I have seen in one of the article where it talks about JBoss and Cors 
  <a href="http://hpehl.info/independent-jboss-admin-console.html" rel="nofollow">http://hpehl.info/independent-jboss-admin-console.html</a>  </p>
  
  <p>I downloaded the file org.jboss.as.domain.http.server.DomainApiHandler to be changed on the server side that is been talked about "For the JBoss AS this implies changes to the class org.jboss.as.domain.http.server.DomainApiHandler. This class handles HTTP requests to the management API. The modified version accepts preflighted OPTIONS requests and sets the relevant response headers."  </p>
  
  <p>I am not sure where can i set the <strong>OPTIONS</strong> on the server in which config file as it says "It is up to the server to decide which origins are allowed"</p>