1
servicemixにangular2 Webアプリケーションをwarファイルとしてデプロイします。これにより、アプリはlocalhost:8181/angular2webapp
のURLで実行されます。基本的にはラクダコンポーネントであるRESTリクエスト用にバンドルがインストールされています。Apache ServiceMixでCORSを有効にします
<cxf:rsServer id="rsServer" address="http://localhost:9090"
serviceClass="com.mypackage.class.MyClass" />
今、このangular2アプリを使用して、私は
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8181' is therefore not allowed access.
を取得していながら、私は自分のルートで.setHeader("Access-Control-Allow-Origin", constant("*"))
を使用してみましたが、動作するようには思えません。 誰もがこれで私を助けてくれますか?