前端项目跨域问题

阅读更多
前端项目访问主干项目出现跨域问题的解决方案:

1、主干项目为maven项目

    在pox.xml文件中加入相应的包

   
     
          org.eclipse.jetty
          jetty-servlets
          9.3.0.M2
      


    在web.xml中配置如下:

      

    
        cross-origin
        org.eclipse.jetty.servlets.CrossOriginFilter
        
            allowedOrigins
            *
        
        
            allowedMethods
            GET,POST,HEAD
        
        
            allowedHeaders
            X-Requested-With,Content-Type,Accept,Origin
        
    
    
        cross-origin
        /*
    


你可能感兴趣的:(前端项目跨域问题)