tomcat – 需要从SAP Fiori中的其他主机加载UI5模块

栏目: Java · 发布时间: 7年前

内容简介:翻译自: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


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Math Adventures with Python

Math Adventures with Python

Peter Farrell / No Starch Press / 2018-11-13 / GBP 24.99

Learn math by getting creative with code! Use the Python programming language to transform learning high school-level math topics like algebra, geometry, trigonometry, and calculus! In Math Adventu......一起来看看 《Math Adventures with Python》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

SHA 加密
SHA 加密

SHA 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具