内容简介:翻译自:https://stackoverflow.com/questions/38801099/need-to-load-the-ui5-module-from-other-host-in-sap-fiori
我们有2个应用程序,一个是部署在SAP ABAP存储库中的SAP Fiori App,另一个是与SAP无关的OpenUI5编写的应用程序,因此我们部署在Apache Tomcat中.
我们需要整合这两个应用程序,比如点击Fiori应用程序中的按钮需要打开OpenUI5应用程序.
问题是部署在Tomcat上的模块(App)无法打开,因为当我们注册模块路径时,fiori没有采取多米诺
jQuery.sap.addUrlWhitelist("http", "tomcat.server.host", "7070", "/tomcatapp/resources/js/ui5widgets"); jQuery.sap.registerModulePath("com.xxx.yyy", "http://tomcat.server.host:7070/tomcatapp/resources/js/ui5widgets");
当我需要的时候
错误是
core-min-0-dbg.js:17351 Uncaught Error: failed to load 'com/xxx/yyy/aaa/bbb.js' from /sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js: 0 - AbortError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://sap.netweaver.net:2020/sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js'.(…)
如果我做
jQuery.sap.registerModulePath("test.test", "http://www.google.de"); jQuery.sap.require("test.test.MyTest");
该文件已正确解析为 http://www.google.de/MyTest.js .
您确定您的包名不会被其他内容覆盖吗?例如像’sap.ui.something’这样的软件包名称显然是个坏主意.但是有一些不太明显的例子.可能是你展示了更多/真实的代码?
无论如何,你将不得不照顾 CORS
翻译自:https://stackoverflow.com/questions/38801099/need-to-load-the-ui5-module-from-other-host-in-sap-fiori
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
RESTful Web Services Cookbook
Subbu Allamaraju / Yahoo Press / 2010-3-11 / USD 39.99
While the REST design philosophy has captured the imagination of web and enterprise developers alike, using this approach to develop real web services is no picnic. This cookbook includes more than 10......一起来看看 《RESTful Web Services Cookbook》 这本书的介绍吧!