License"
Line 23: | Line 23: | ||
= Specify The Path in a System Property = | = Specify The Path in a System Property = | ||
− | Because <tt>Library.getProperty()</tt> will look for a system property if no corresponding property defined in <tt>zk.xml</tt>. | + | Because <tt>Library.getProperty()</tt><ref>https://www.zkoss.org/javadoc/latest/zk/org/zkoss/lang/Library.html#getProperty(java.lang.String)</ref> will look for a system property if no corresponding property defined in <tt>zk.xml</tt>. |
For example in a Tomcat, you can add a <tt>setenv.sh</tt> (or <tt>setenv.bat</tt>) that contains | For example in a Tomcat, you can add a <tt>setenv.sh</tt> (or <tt>setenv.bat</tt>) that contains | ||
Line 34: | Line 34: | ||
You can find a way to set a system property upon your application server. In conclusion, you can pass the path in any way that can be retrieved by Java's <tt>System.gerProperty()</tt>, e.g. a system variable in Windows. | You can find a way to set a system property upon your application server. In conclusion, you can pass the path in any way that can be retrieved by Java's <tt>System.gerProperty()</tt>, e.g. a system variable in Windows. | ||
+ | |||
+ | |||
+ | <references/> | ||
+ | |||
{{ZKSpreadsheetEssentialsPageFooter}} | {{ZKSpreadsheetEssentialsPageFooter}} |
Revision as of 06:35, 21 January 2016
Default License Loading Path
ZSS loads a license file from the default path WEB-INF/classes/metainfo/zss/license. If the license is loaded successfully, you should see some license information printed on your application console.
Specify Loading Path with a Library Property
Some application servers like Weblogic could fail to locate the license file in the default path. You shall put the following library property in zk.xml to specify the license directory and copy your ZSS license file there.
<library-property>
<name>org.zkoss.zssex.rt.Runtime.directory</name>
<value>c:/my-directory/my-licenses</value>
</library-property>
Specify The Path in a System Property
Because Library.getProperty()[1] will look for a system property if no corresponding property defined in zk.xml.
For example in a Tomcat, you can add a setenv.sh (or setenv.bat) that contains
export CATALINA_OPTS="$CATALINA_OPTS -Dorg.zkoss.zssex.rt.Runtime.directory=/yourLicenseFilePath/onThisServer"
Tomcat catalina.sh will invoke this script if exists.
You can find a way to set a system property upon your application server. In conclusion, you can pass the path in any way that can be retrieved by Java's System.gerProperty(), e.g. a system variable in Windows.
All source code listed in this book is at Github.