通过 url 参数 parameters 和 script tag 属性来配置 SAP UI5 运行时
Configuration of the SAPUI5 Runtime using URL parameters
新建一个 SAP UI5 应用,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' /><scriptsrc="resources/sap-ui-core.js" id="sap-ui-bootstrap"data-sap-ui-libs="sap.m">
</script><script>// Set the log level to INFOjQuery.sap.log.setLevel(jQuery.sap.log.Level.INFO);// Get reference the Core objectvar oCore = sap.ui.getCore();// Read Corevar oLibMap = oCore.getLoadedLibraries();for (key in oLibMap) {jQuery.sap.log.info("Loaded Library name", key);}jQuery.sap.log.info("Has model?", oCore.hasModel().toString());jQuery.sap.log.info("Is mobile?", oCore.isMobile().toString());// Read Configuration object from the Corevar oConfig = oCore.getConfiguration();jQuery.sap.log.info("Accessibility", oConfig.getAccessibility().toString());jQuery.sap.log.info("Debug", oConfig.getDebug().toString());jQuery.sap.log.info("Language", oConfig.getLanguage());jQuery.sap.log.info("Locale", oConfig.getLocale());jQuery.sap.log.info("Version of SAPUI5 Framework", oConfig.getVersion());jQuery.sap.log.info("Theme", oConfig.getTheme());jQuery.sap.log.info("User agent", navigator.userAgent);// Reset the log level to default of ERROR jQuery.sap.log.setLevel(jQuery.sap.log.Level.ERROR);
</script></head>
<body class="sapUiBody" role="application"><div id="content"></div>
</body>
</html>
使用如下的 url 进行测试:
http://localhost:8080/sapui5.configurl.demo?sap-ui-accessibility=false&sap-ui-debug=false&sap-ui-language=de&sap-ui-theme=sap_bluecrystal&data-sap-ui-xx-fakeOS=ios
请根据您的服务器配置使用端口号。 加载 index.html 将在开发者工具控制台中打印日志。 该 URL 包含多个配置参数(格式为 sap-ui-PARAMETER-NAME = ”value”),由第二个脚本区域中的代码读取。 日志级别从默认的 ERROR 更改为 INFO 并返回以打印 jQuery.sap.log.info () 语句。
Configuration of the SAPUI5 Runtime using script tag attributes
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' /><scriptsrc="resources/sap-ui-core.js" id="sap-ui-bootstrap"data-sap-ui-libs="sap.m" data-sap-ui-accessibility="false"data-sap-ui-debug="false"data-sap-ui-language="de"data-sap-ui-theme="sap_bluecrystal" data-sap-ui-xx-fakeOS="ios">
</script><script>// Set the log level to INFOjQuery.sap.log.setLevel(jQuery.sap.log.Level.INFO);// Get reference the Core objectvar oCore = sap.ui.getCore();// Read Corevar oLibMap = oCore.getLoadedLibraries();for (key in oLibMap) {jQuery.sap.log.info("Loaded Library name", key);}jQuery.sap.log.info("Has model?", oCore.hasModel().toString());jQuery.sap.log.info("Is mobile?", oCore.isMobile().toString());// Read Configuration object from the Corevar oConfig = oCore.getConfiguration();jQuery.sap.log.info("Accessibility", oConfig.getAccessibility().toString());jQuery.sap.log.info("Debug", oConfig.getDebug().toString());jQuery.sap.log.info("Language", oConfig.getLanguage());jQuery.sap.log.info("Locale", oConfig.getLocale());jQuery.sap.log.info("Version of SAPUI5 Framework", oConfig.getVersion());jQuery.sap.log.info("Theme", oConfig.getTheme());jQuery.sap.log.info("User agent", navigator.userAgent);// Reset the log level to default of ERROR jQuery.sap.log.setLevel(jQuery.sap.log.Level.ERROR);
</script></head>
<body class="sapUiBody" role="application"><div id="content"></div>
</body>
</html>
在浏览器中打开如下网址 http://localhost:8080/sapui5.config.demo/
请根据您的服务器配置使用端口号。 加载 index.html 将在开发者工具控制台中打印日志。 第一个脚本区域(也称为 Bootstrap)中的代码包含多个配置参数(格式为 data-sap-ui-PARAMETER-NAME = ”value”),由第二个脚本区域中的代码读取。 日志级别从默认的 ERROR 更改为 INFO 并返回以打印 jQuery.sap.log.info () 语句。
更多Jerry的原创文章,尽在:“汪子熙”:
通过 url 参数 parameters 和 script tag 属性来配置 SAP UI5 运行时相关推荐
- SAP UI5 Simple Form 属性 columnsL,columnsM,columnsXL 的属性深入剖析试读版
一套适合 SAP UI5 初学者循序渐进的学习教程 本专栏计划的文章数在 300 篇左右,到 2022年9月22日为止,目前已经更新了 133 篇,专栏完成度为 44.3%. 作者简介 Jerry W ...
- 转发和重定向简介及与之相关的(URL)参数(parameter)、属性(attribute)问题探讨
转发和重定向简介及与之相关的(URL)参数(parameter).属性(attribute)问题探讨 蜀中孤鹰 2019-07-15 15:55:49 101 收藏 最后发布:2019-07-15 1 ...
- 前端拦截url参数xss攻击_闲庭信步聊前端 - 漫谈XSS
闲庭信步聊前端 - 漫谈XSS 什么是XSS? 众所周知XSS是Cross-Site Scripting(跨站脚本攻击)的简称,但是英文的缩写明明是CSS为什么叫XSS呢?---历史遗留问题,因为CS ...
- javascript:设置URL参数的方法,适合多条件查询
适用场景:多条件查询情况,如下图所示: 通过设置URL参数,再结合数据源控件设置的RUL参数,就能进行简单的多条件查询了. javascript函数: <mce:script type=&quo ...
- url中传递对象参数_在URL参数中传递复杂对象
url中传递对象参数 假设您想传递原始数据类型,例如复杂的Java对象 java.util.Data,java.lang.List,泛型类,数组以及通过URL参数所需的所有内容,以便在页面加载后在任何 ...
- 在URL参数中传递复杂对象
假设您要传递原始数据类型,例如复杂的Java对象 java.util.Data,java.lang.List,泛型类,数组以及通过URL参数所需的所有内容,以便在页面加载后在任何网页上预设默认值. 共 ...
- [开发笔记]-使用jquery获取url及url参数的方法
转载自:作者:酷小孩 出处:http://www.cnblogs.com/babycool/ 使用jquery获取url以及使用jquery获取url参数是我们经常要用到的操作 1.jque ...
- 使用jquery获取url及url参数的方法
[开发笔记]-使用jquery获取url及url参数的方法 使用jquery获取url以及使用jquery获取url参数是我们经常要用到的操作 1.jquery获取url很简单,代码如下: windo ...
- HTML判断是PC端还是手机端,以及获取url参数
方法一(网上大部分的方法): <script type="text/javascript">var sUserAgent = navigator.userAgent.t ...
最新文章
- 项目总结10:通过反射解决springboot环境下从redis取缓存进行转换时出现ClassCastException异常问题...
- cloudera之hadoop-0.20.1+152.tar.gz 安装出现找不到JAVA_HOME问题的解决办法
- 微信硬件平台智能路由行业解决方案
- 北漂周记--第8记--项目测试
- 原型链的理解_javascript之快速理解(原型链)
- 万字好文 | 数字化转型之道——数据治理体系能力提升
- 脑洞大开!油画渲染的新算法 Paint Transformer!ICCV2021 Oral!
- 几天后自动领取java怎么做的_学了14天,终于把Java项目一做完啦
- EMC之对象参考1 -- 对象基本知识
- poj 2318 TOYS
- 190.颠倒二进制位
- Vim激荡30年发展史
- 手机麦克风结构原理图_麦克风的构造图解 麦克风偏置电路和滤波电路
- 亲爱的程序猿们怎么找工作
- Docker容器内部 DNS 解析失败的问题
- minecraft fabric_server 和 MCDR 安装与运行
- kvm 监控内存,替换页表(linux版的win VT晶核)(这个整复杂了,不用小内核也可以实现,留着吧,主要记录了bootLoad的启动过程)
- 母版页和内容页的使用
- 关于Network ACLs的理解
- ESP8266的Web配网以及强制门户的实现(连接wifi自动打开网页)