0
votes

i am using Eclipse Keepler where i have install Open UI5 plugins. I am able to create a project as SAPUI5 Application Development , i have a index.html page in it by default which has a following line

<body class="sapUiBody" role="application">

here i am getting warning "Undefined attribute name Role" moreover by default in my index.html i have got below generated code under Script Tag.

    <script src="resources/sap-ui-core.js"
            id="sap-ui-bootstrap"
            data-sap-ui-libs="sap.ui.commons"
            data-sap-ui-theme="sap_bluecrystal">
    </script>

where is this sap-ui-core.js file present ? and why i am not able to automatically get sap.ui.core library and sap.ui.localResource class in the Script tag ? I have followed SAP Developers guide but its not helpful. Please help me out as I have just started with OPEN UI5 some link with basic information on it will be helpful.

below is my index.html

<!DOCTYPE HTML>
<html>
   <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>


  <script src="resources/sap-ui-core.js"
        id="sap-ui-bootstrap"
        data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.ui.ux3"
        data-sap-ui-theme="sap_bluecrystal">
  </script>

  <script>
        var myView = new sap.ui.jsview("sampleopenui5/Main");
        myView.placeAt("content");
</script>


</head>
 <body class="sapUiBody" role="application">
  <div id="content"></div>
</body>

below is the error message i am getting

Failed to load resource: the server responded with a status of 404 http://localhost:8758/sapui5/resources/sap-ui-core.js Failed to load resource: the server responded with a status of 404 (Not Found)

2

2 Answers

1
votes

When running on Tomcat, the resources "folder" is actually set up as a servlet unpacked from a jar file. If you look in the WEB-INF/web.xml file you'll see this:

<!-- ============================================================== -->
<!-- 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>

Your Tomcat server should show the jar deployed in your Servers tab:

Servers tab showing resources jar

If you set up the UI5 library for any web server, you'd just have copied the resources folder out of the openui5 sdk distribution and put it in your project.

2
votes

The 'Undefined attribute name Role' indicates your DOCTYPE is incorrect. It should be html

If you run your application on the local eclipse web server, there should be no problem finding the resources. So how do you run your application?