Enabling Cross Site Requests in Tomcat
===

First, this may be marked as duplicate question, but the other questions were not answered at all.I think no one found it interesting.

I wanted to enable Cross-Site requests in my tomcat server. Google shows that in apache, we can enable a cross site by adding 

    Access-Control Allow-Origin.
How  to get this done in tomcat . I would like two things, First opening access to everyone and second, access for limited sites.

Is it Possible and if so, how can it be done.

How come API's are working , if Cross Site requests are not possible. I can send some data to Paypal server and i get response back. I know that's done in some server side languages(Java,PHP). But i want to know if it's possible from Java Script too,

