i have a huge problem with CORS on my server. My server is running on Tomcat on localhost. The server i implemented has a couple of RestFul resources. 
For example:

@Path("user")
public class UserService {
@GET
@Path("/{username}/{password}")
@Produces("text/plain")
public String checkLoginParameter(@PathParam("username") String username, @PathParam("password") String password) {
        String tempUserName = "";
        String tempPassword = "";
        String bool = "";

        EntityManager em = createEntityManager();
        try{
            User user = (User)em.createQuery("SELECT u FROM User u WHERE u.username='"+username+"' AND u.password='"+password+"'").getSingleResult();
            tempUserName = user.getUsername();
            tempPassword = user.getPassword();
        }
        catch(Exception e){}

        if(username.equals(tempUserName) &amp;&amp; !username.isEmpty() &amp;&amp; password.equals(tempPassword) &amp;&amp; !password.isEmpty()){
            bool = "true";
        }
        else{
            bool = "false";
        }
        return bool;
   }      
}


The Ressource is working. 
Now i want to access to the Ressource via JavaScript from a different Website. When i try to do this, i get a Error message:

XMLHttpRequest cannot load http://localhost:8080/RSAppStore/user/poc/poc. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.


I know i have add to my Server the Permission for CORS.
I do it this way:

web.xml:

&lt;filter&gt;
&lt;filter-name&gt;CORS&lt;/filter-name&gt;
&lt;filter-class&gt;com.thetransactioncompany.cors.CORSFilter&lt;/filter-class&gt;
&lt;init-param&gt;
 &lt;param-name&gt;cors.allowOrigin&lt;/param-name&gt;
    &lt;param-value&gt;*&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;init-param&gt;
 &lt;param-name&gt;cors.supportedMethods&lt;/param-name&gt;
    &lt;param-value&gt;GET, POST, HEAD, PUT, DELETE&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;init-param&gt;
&lt;param-name&gt;cors.supportedHeaders&lt;/param-name&gt;
&lt;param-value&gt;*&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;init-param&gt;
    &lt;param-name&gt;cors.exposedHeaders&lt;/param-name&gt;
    &lt;param-value&gt;Set-Cookie&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;init-param&gt;
    &lt;param-name&gt;cors.supportsCredentials&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;/filter&gt;
&lt;filter-mapping&gt;
&lt;filter-name&gt;CORS&lt;/filter-name&gt;
&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;


To access with JavaScript:

&lt;script type="text/javascript"&gt;
$(function(){
  $.ajax({
    type: "GET",
    crossDomain: true,
    url: "http://robosmart-appstore:robosmart@localhost:8080/RSAppStore/user/poc/poc",

    contentType: "text/plain",
    success: function( string ) {

      console.log(string);  


    },
    error:function () {
      console.log("err");
    }
  });
});
&lt;/script&gt;


In addition i have added these 2 jars.

cors-filter-1.9.2.jar
java-property-utils-1.9.jar


I read so many examples and explanations on the Internet, but nothing seems to work and i don't know what i am doing wrong.


Question: Are there any Christian denominations that incorporate Odinism?
Answer: We don't know as much about the German religion as the Greek and Roman ones, because the Germans used less permanent materials in their society, and didn't really write things down. What we have regarding them now is whatever Romans and Greeks decided to write down, and whatever elements were, as you pointed out, incorpated into the culture after Christianization. 

"Odinism" is polytheistic, while Christianity is ruthlessly monotheistic. At most a Christian could believe that the German gods were demons misleading people, or angels whose message was misunderstood. Most just say they were idols, or, for those like C. S. Lewis and G. K. Chesterton, saw the myths as factually false, but true in that they revealed a need of the human heart, a need that was fulfilled by Christ. Just as a boy might daydream about what his future wife might be like, and then later on in life meet her in reality, so the pagan myth makers were daydreaming about their Bridegroom, who they met Him for real by the Incarnation. For more detail regarding this, I highly, highly, recommend reading G. K. Chesterton's The Everlasting Man, especially the chapter "Man and Mythologies," which is one of the best essays he has ever written. You can find it here: http://www.cse.dmu.ac.uk/~mward/gkc/books/everlasting_man.html#chap-I-v*

There are many elements of German belief in our society that were incorpated into culture practiced by later Christians. For example, our English weekday calendar, except for Saturday (who is a Roman god), are all Anglo-Saxon deities. The name "Easter" refers to the Old English name for the month of April, who was a fertility goddess (just as April is itself named after the Greek fertility goddess Aphrodite). Santa Clause might be based on an Old Norse legend involving Odin/Wodin. Just because things were pagan, doesn't make them wrong per se, because paganism is the religion of humanity, or at least of a fallen humanity. When Christ came, He didn't come to reject all of paganism, for that would be to reject humanity. Rather, He, and the Church, took what was good, and rejected what was bad, based on the doctrines of faith, just as the Israelites savaged the spoils from Egypt. The spoils weren't wrong and evil per se, they were just in the hands of the pagans and the evildoers.

Think about it. The New Testament is written in common Greek, a language created by pagans and used by pagans. Do you really think the Apostles should have rejected the pagan language just because it was pagan?

Christi pax.

*Here's an audio recording: https://archive.org/details/EverlastingMan (pick Book I, Chapter V). I got all this from this website ultimately: http://www.cse.dmu.ac.uk/~mward/gkc/books/index.html