zk.xml"
Charlesqiu (talk | contribs) |
Charlesqiu (talk | contribs) |
||
Line 38: | Line 38: | ||
</source> | </source> | ||
− | The ZK schema can be downloaded from [http://www.zkoss.org/2018/zk/zk.xsd http://www.zkoss.org/2018/zk/zk.xsd]. In addition, you can find | + | The ZK schema can be downloaded from [http://www.zkoss.org/2018/zk/zk.xsd http://www.zkoss.org/2018/zk/zk.xsd]. In addition, you can find zk.xsd under the dist/xsd directory in the [https://www.zkoss.org/wiki/ZK_Installation_Guide/ZK_Background/The_Content_of_ZK_Binary_Distribution ZK binary distribution]. |
{{ZKConfigurationReferenceHeadingToc}} | {{ZKConfigurationReferenceHeadingToc}} |
Revision as of 06:15, 12 November 2018
WEB-INF/zk.xml is the configuration descriptor of ZK. This file optional. If you need to configure ZK differently from the default, you could provide a file called zk.xml under the WEB-INF directory.
The root element must be <zk>. Then, you could specify any combination of the following element under the root element.
File Location
You can place zk.xml in either a WAR file or a JAR file.
WEB-INF/zk.xml
zk.xml
is usually packed with a Web application and it should be located under WEB-INF
.
metainfo/zk/zk.xml
[since 3.6.0]
For library providers, zk.xml
is better to pack with a JAR file. This can be done by placing zk.xml in the metainfo/zk
directory identifiable by the classpath (i.e., in a JAR file).
Additonal Configuration File
[since 5.0.7]
In addition, you could specify an additional configuration file in a library or system property called org.zkoss.zk.config.path. It is useful if some of the configuration can not be part of the WAR file (such as depending on the deployment environment). For more information, please refer to this section.
Notice that zk.xml
found in the classpath is parsed first, then WEB-INF/zk.xml
, and finally the additional configuration file. It means the additional configuration file, if any, has the highest priority, and WEB-INF/zk.xml
(since the later will overrides the previous one if conflicts).
XML Schema Definition
[since 8.6.1]
You could specify the XML schema in the zk.xml as shown below. Many XML editors works better, such as when with auto-complete, if XML schema is specified correctly.
<zk xmlns="http://www.zkoss.org/2018/zk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2018/zk http://www.zkoss.org/2018/zk/zk.xsd">
The ZK schema can be downloaded from http://www.zkoss.org/2018/zk/zk.xsd. In addition, you can find zk.xsd under the dist/xsd directory in the ZK binary distribution.