The zscript-config Element

From Documentation
Revision as of 04:10, 9 July 2010 by Maya001122 (talk | contribs)

It configures the interpreters to interpret the zscript codes. The allowed child element is language-name and interpreter-class. You might have multiple zscript-config elements in one zk.xml.

 <zscript-config>
     <language-name>Java</language-name><!-- case insensitive -->
     <interpreter-class>my.MySuperJavaInterpreter</interpreter-class>
 </zscript-config>

Note: Unlike most other configurations defined in WEB-INF/zk.xml, the definitions defined in zscript-config are applied to all Web applications sharing the same zk.jar.

In other words, the scripting language defined here are visible to all Web applications sharing the same zk.jar. Furthermore, it may cause errors in another Web application, if the classes or resources are available only in the Web application defining this.

Thus, if it is an issue, just put zk.jar and relevant ZK libraries under the WEB-INF/lib directory.

The language-name Element

[Required]

It specifies the language name. It is case insensitive. The previous implementation with the same language name will be replaced if any.

The interpreter-class Element

[Required]

It specifies the implementation class. It must implement the Interpreter interface. Instead of implementing it from scratch, you can derive from the GenericInterpreter class. If you want to support the hierarchical scopes (i.e., one interpreter scope per namespace), it can also implement the HierachicalAware interface.