on 08-06-2014 11:39 AM
Hi,
I am trying to wrap a SAPUI5 SplitApp application using cordova 3.4.0 and run it from an android device.
After much R&D, the application seems to be running fine but there is a small glitch here...
I'm unable to access the SAPUI5 libraries from the project placed on my desktop [i.e. src="resources/sap-ui-core.js"] in the below script. It gives a timeout network error when I try to do so. But, the project runs absolutely fine when I refer the online library for the resource folder [i.e. src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"].
Location where the resource folder is currently saved on my desktop after downloading the UI_Development_Toolkit_for_HTML5_Version_SAPUI5_1_16_3_278_MB.zip and extracting the same:-
D:\cordova-3.4.0\cordova-android\cordova-android\bin\MyFirst\assets\www\resources
e.g.:-
<script
type="text/javascript"
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.layout,sap.ui.core,sap.ui.table"
data-sap-ui-theme="sap_bluecrystal">
</script>
SAP UI5 Project Structure screenshot:-
“Main.html” file structure screenshot:-
index.html is a dummy html file that refer the main.html (which has the actual coding) file.
MyFirstCordova.java file structure screenshot:-
Below is the error screenshot when I try to access the resources folder from the project:-
NOTE: The View.view.js file has all the SAPUI5 code.
Regards,
Aaron D’C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aaron,
maybe i can give some information about the mentioned statement [src="resources/sap-ui-core.js"] and your associated problems.
The point is that all files, which are loaded over "resources/*", are served by a special resource-servlet within your Java Servlet-Container. When you have a look at your web.xml, you will see the following part.
<!-- ============================================================== -->
<!-- UI5 resource servlet used to handle application resources -->
<!-- ============================================================== -->
<servlet>
<display-name>ResourceServlet</display-name>
<servlet-name>ResourceServlet</servlet-name>
<servlet-class>com.sap.ui5.resource.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ResourceServlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
When your Java-Server is not running and you are starting the index.html in your browser, you will always getting error messages in the browser console (because your Servlet is not available and therefore can't serve the framework-libs). To fix this, you need to load the framework from a different location in a static way.
Regards
Michael
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.