Jetty Cross Origin Filter

前端 未结 5 1866
故里飘歌
故里飘歌 2020-12-04 15:36

I\'ve configured Jetty\'s cross origin filter, but I continue to get the following error. Does anyone know what is wrong and how to fix it? Below the error message is my ove

5条回答
  •  一个人的身影
    2020-12-04 16:06

    I ran into this when doing crossdomain calls to web apps deployed to GAE. You can add an explicit header to your Servlet(s) responses, like:

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException 
    {
        res.addHeader("Access-Control-Allow-Origin", "*");
        ...
    }
    

    and also make sure you have a crossdomain.xml policy file in the root of your WAR, like:

    
    
     
    

    HTH.

提交回复
热议问题