简体   繁体   English

耳模之间的通讯

[英]communication between ear modules

Hi i am working on a project where there is a REST service deployed as part of an ear and our application is deployed as a different ear . 嗨,我正在做一个项目,在该项目中,REST服务被部署为耳朵的一部分,而我们的应用程序被部署为另一只耳朵。 (let me call is restapi.ear and myapplication.ear) . (让我叫restapi.ear和myapplication.ear)。

We have a GUI deployed in myapplication.ear , but we want to access some REST services through our GUI. 我们在myapplication.ear中部署了一个GUI,但是我们想通过我们的GUI访问一些REST服务。 So basically the js file within the myapplication.ear will be using the REST APIs exposed by restapi.ear . 因此,基本上,myapplication.ear中的js文件将使用restapi.ear公开的REST API。

I read about the cross domain js problems so would like to get suggestions about how to allow this communication . 我了解了跨域js问题,因此希望获得有关如何允许这种通信的建议。 What are the best practices which i have to follow to allow this integration. 我必须遵循的最佳实践是什么才能实现这种集成。

You can configure your server to support CORS 您可以配置服务器以支持CORS
You can take a look tomcat one for example tomcat 7 CORS_Filter 您可以看一下tomcat之一,例如tomcat 7 CORS_Filter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM