服务器的响应状态为404(找不到资源!)SAPUI5

服务器的响应状态为404(找不到资源!)SAPUI5,sapui5,Sapui5,所以我刚刚使用Eclipse和SAP UI5创建了一个项目 这是我的Index.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="

所以我刚刚使用Eclipse和SAP UI5创建了一个项目

这是我的Index.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.m"
                data-sap-ui-theme="sap_bluecrystal"
                data-ui-resourceroots='{"sap.myApp":"./"}'>
        </script>
        <!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

        <script type="text/javascript">

        sap.ui.getCore().attachInit(function()
                {
            sap.ui.xmlview({
                viewName: "sap.myApp.view.App"
            }).placeAt("content");
                });
        </script>

    </head>
    <body class="sapUiBody" role="application">
        <div id="content"></div>
    </body>
</html>
视图名为App.view.xml

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    controllerName="sap.myApp.controller.App" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
    <content>
<Image src="http://www.w3schools.com/css/img_fjords.jpg"/>
    </content>
</Page>
谁能告诉我我做错了什么


谢谢。

您的sap.myApp命名空间的目录映射不起作用。映射属性名为
数据sap ui resourceroots


正确的属性名称应该是
数据sap ui resourceroots
。但是,您的应用程序还有另一个问题。除非您正在开发SAPUI5/OpenUI5内容,否则不得使用名称空间
sap
。请检查一下电话号码

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
    controllerName="sap.myApp.controller.App" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
    <content>
<Image src="http://www.w3schools.com/css/img_fjords.jpg"/>
    </content>
</Page>
sap-ui-core.js:126 GET http://localhost:55694/HelloWorld/resources/sap/myApp/view/App.view.xml 404 (Resource could not be found!)send @ sap-ui-core.js:126ajax @ sap-ui-core.js:126q.sap.loadResource @ sap-ui-core.js:174f.initViewSettings @ library-preload.js:907c._initCompositeSupport @ library-preload.js:862(anonymous function) @ sap-ui-core.js:461constructor @ sap-ui-core.js:461constructor @ sap-ui-core.js:971constructor @ sap-ui-core.js:805f @ sap-ui-core.js:638f @ sap-ui-core.js:638sap.ui.view @ library-preload.js:881sap.ui.xmlview @ library-preload.js:891o.(anonymous function) @ sap-ui-core.js:393(anonymous function) @ index.html:19(anonymous function) @ sap-ui-core.js:861each @ sap-ui-core.js:115w._executeInitListeners @ sap-ui-core.js:861w.init @ sap-ui-core.js:856w.handleLoad @ sap-ui-core.js:862(anonymous function) @ sap-ui-core.js:838l @ sap-ui-core.js:172S.finishTask @ sap-ui-core.js:172(anonymous function) @ sap-ui-core.js:838p @ sap-ui-core.js:126fireWith @ sap-ui-core.js:126ready @ sap-ui-core.js:126V @ sap-ui-core.js:126
sap-ui-core.js:174 Uncaught Error: resource sap/myApp/view/App.view.xml could not be loaded from resources/sap/myApp/view/App.view.xml. Check for 'file not found' or parse errors. Reason: Resource could not be found!(…)