How to Support More Scripting Languages"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} Currently ZK supports Java, JavaScript, Ruby and Groovy. However, it is easy to extend: # Provides a class that implements the <javadoc type="in…')
 
m (correct highlight (via JWB))
 
(8 intermediate revisions by one other user not shown)
Line 3: Line 3:
 
Currently ZK supports Java, JavaScript, Ruby and Groovy. However, it is easy to extend:
 
Currently ZK supports Java, JavaScript, Ruby and Groovy. However, it is easy to extend:
  
# Provides a class that implements the <javadoc type="interface">org.zkoss.zk.scripting.Interpreter</javadoc> interface. Instead of implementing it directly, you can derive from the <javadoc>org.zkoss.zk.scripting.util.GenericInterpreter</javadoc> class, if you'd like to handle namespaces directly. Or, you can derive from the <javadoc>org.zkoss.scripting.bsh.BSFInterpreter</javadoc> class, if the interpreter supports BSF (Bean Scripting Framework).
+
# Provides a class that implements the <javadoc type="interface">org.zkoss.zk.scripting.Interpreter</javadoc> interface. Instead of implementing it directly, you can derive from the <javadoc>org.zkoss.zk.scripting.util.GenericInterpreter</javadoc> class, if you'd like to handle namespaces directly. Or, you can derive from the <javadoc>org.zkoss.zk.scripting.bsh.BSHInterpreter</javadoc> class, if the interpreter supports BSF (Bean Scripting Framework).
# Declares the scripting language in either <tt>WEB-INF/zk.xml</tt>, or <tt>zk/config.xml</tt>.
+
# Declares the scripting language in either <code>WEB-INF/zk.xml</code>, or <code>zk/config.xml</code>.
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 13: Line 13:
 
</source>
 
</source>
  
Refer to '''the Developer's Reference''' for the details about <tt>WEB-INF/zk.xml</tt>. Refer to '''the Component Development Guide''' for the details about <tt>zk/config.xml</tt>.
+
Refer to [http://books.zkoss.org/wiki/ZK_Configuration_Reference '''the Developer's Reference'''] for the details about <code>WEB-INF/zk.xml</code>. Refer to [http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml '''the Component Development Guide'''] for the details about <code>zk/config.xml</code>.
  
 
{{ ZKDevelopersGuidePageFooter}}
 
{{ ZKDevelopersGuidePageFooter}}

Latest revision as of 10:35, 19 January 2022

How to Support More Scripting Languages


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Currently ZK supports Java, JavaScript, Ruby and Groovy. However, it is easy to extend:

  1. Provides a class that implements the Interpreter interface. Instead of implementing it directly, you can derive from the GenericInterpreter class, if you'd like to handle namespaces directly. Or, you can derive from the BSHInterpreter class, if the interpreter supports BSF (Bean Scripting Framework).
  2. Declares the scripting language in either WEB-INF/zk.xml, or zk/config.xml.
<zscript-config>
        <language-name>SuperJava</language-name><!-- case insensitive -->
        <interpreter-class>my.MySuperJavaInterpreter</interpreter-class>    
</zscript-config>

Refer to the Developer's Reference for the details about WEB-INF/zk.xml. Refer to the Component Development Guide for the details about zk/config.xml.



Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.