使用属性文件指定zul文件中文件的位置

时间:2016-06-08 09:51:31

标签: zk zul

我在本地服务器(localhost:8080)上运行zul文件,该文件使用存储在单独本地服务器(localhost:3000)中的JavaScript文件:

<script type="text/javascript" src="http://localhost:3000/javascript/bower_components/angular/angular.js"></script>

如果我想将单独的本地服务器的url放在属性文件中,那么这样做的最佳方法是什么?我试图添加一个占位符:

<script type="text/javascript" src="${graph.widget.url}/javascript/bower_components/angular/angular.js"></script>

然后添加属性文件:

graph.widget.url=http://localhost:3000

然后添加zk.xml文件:

<system-config>
    <label-location>file:///home/asd/resources/dev-common.properties</label-location>
</system-config>

但不知何故它不起作用:它查找http://localhost:8080/javascript/bower_components/angular/angular.js(运行应用程序的本地服务器)而不是http://localhost:3000/javascript/bower_components/angular/angular.js。我做错了什么?

提前致谢!

1 个答案:

答案 0 :(得分:1)

您必须在密钥前加labels段。

<script 
    type="text/javascript" 
    src="${labels.graph.widget.url}/javascript/bower_components/angular/angular.js">
</script>

来源:https://www.zkoss.org/wiki/ZUML_Reference/EL_Expressions/Implicit_Objects/labels

相关问题