I created several SAPUI5 web applications in Eclipse that have been deployed to a SAP NetWeaver PO 7.5 Application Server.
All these applications use generic components of a "common" project. I just made them available via the html header with this bootstrapping script-tag:
<!-- Bootstrapping UI5 -->
<script id="sap-ui-bootstrap"
src="/sapui5/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="path.to.custom.theme"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"com.namespace.ui.specificapp": ".", "com.namespace.ui.common" :"/com.namespace~ui~common~web"}'
data-sap-ui-frameOptions="trusted"
data-sap-ui-appCacheBuster = "./,/com.namespace~ui~common~web/" >
</script>
This worked fine until I tiered to transfer these applications to SAP Cloud.
I imported the projects to WebIDE and first thing I discovered was that data-sap-ui-resourceroots
attribute doesn't work anymore because application cannot find the components from the common project. So I deployed the common application to SAP Cloud and inserted the corresponding URL in the bootstrapping script-tag of the index.html like this:
<script id="sap-ui-bootstrap"
src="/sapui5/resources/sap-ui-cachebuster/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="path.to.custom.theme"
data-sap-ui-compatVersion="edge"
data-sap-ui-resourceroots='{"com.namespace.ui.specificapp": ".", "com.namespace.ui.common" :"/https://common-aXXXXXXXX.dispatcher.hana.ondemand.com/"}'
data-sap-ui-frameOptions="trusted"
data-sap-ui-appCacheBuster = "./,/com.namespace~ui~common~web/" >
This allows browser to find the JS-files from the common project, but leads to this error:
Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed.
This is message is thrown by the https://common-aXXXXXXXX.dispatcher.hana.ondemand.com/ host.
Analysing the HTTP request I see that the parameter Accept:text/plain, */*; q=0.01
is set.
I don't know why SAPUI5 is requesting plain text or where I can change this behavior. Does anyone know how to tranfer this application structure to the SAP Cloud?