org.zkoss.zk.config.path"
m (correct highlight (via JWB)) |
|||
Line 9: | Line 9: | ||
[since 5.0.7] | [since 5.0.7] | ||
− | It specifies another configuration file in addition to < | + | It specifies another configuration file in addition to <code>WEB-INF/zk.xml</code>. This is useful if you have two or more environments, such as testing and production. Then, you could put the different configuration into separate files and load the required files based on the requirement. |
The value could be one of the following: | The value could be one of the following: | ||
Line 17: | Line 17: | ||
* '''A URL''', such as <code><nowiki>http://foo.com/config/zk.xml</nowiki></code>. Notice it must starts with <code>http://</code>, <code>https://</code>, and <code>ftp://</code>. | * '''A URL''', such as <code><nowiki>http://foo.com/config/zk.xml</nowiki></code>. Notice it must starts with <code>http://</code>, <code>https://</code>, and <code>ftp://</code>. | ||
− | Notice that < | + | Notice that <code>WEB-INF/zk.xml</code> is always loaded, and it is loaded before the configuration file specified in this system property. Thus, you could put the configurations common to each environment in <code>WEB-INF/zk.xml</code>, and put the difference to the extra configuration file. |
− | For example, assume you put the configuration in a file called < | + | For example, assume you put the configuration in a file called <code>/configs/zk-production.xml</code>, then you could specify <code>-Dorg.zkoss.zk.config.path=file:/configs/zk-production.xml</code> as one of the arguments when starting the Web server. |
Another example is to provide an ID generator for the testing purpose. For more information, please refer to [[ZK Developer's Reference/Testing/Testing Tips#Different_Configuration_for_Different_Environment|ZK Developer's Reference: Testing Tips]]. | Another example is to provide an ID generator for the testing purpose. For more information, please refer to [[ZK Developer's Reference/Testing/Testing Tips#Different_Configuration_for_Different_Environment|ZK Developer's Reference: Testing Tips]]. |
Revision as of 10:19, 19 January 2022
Property:
org.zkoss.zk.config.path
Applicable: globally in zk.xml via <library-property> not as <custom-attribute>
Default: none [since 5.0.7]
It specifies another configuration file in addition to WEB-INF/zk.xml
. This is useful if you have two or more environments, such as testing and production. Then, you could put the different configuration into separate files and load the required files based on the requirement.
The value could be one of the following:
- A servlet path, such as
/WEB-INF/config/zk-extra.xml
- A file path, such as
file:///home/http/zk.xml
andfile:///C:/test/zk.xml
, if you use Windows. Notice it must start withfile://
[1]. - A URL, such as
http://foo.com/config/zk.xml
. Notice it must starts withhttp://
,https://
, andftp://
.
Notice that WEB-INF/zk.xml
is always loaded, and it is loaded before the configuration file specified in this system property. Thus, you could put the configurations common to each environment in WEB-INF/zk.xml
, and put the difference to the extra configuration file.
For example, assume you put the configuration in a file called /configs/zk-production.xml
, then you could specify -Dorg.zkoss.zk.config.path=file:/configs/zk-production.xml
as one of the arguments when starting the Web server.
Another example is to provide an ID generator for the testing purpose. For more information, please refer to ZK Developer's Reference: Testing Tips.
- ↑ For more information about the URI of a file, please refer to File URI scheme.
Version History
Version | Date | Content |
---|---|---|
5.0.7 | April, 2011 | Introduced |