The xel-config Element"

From Documentation
m (correct highlight (via JWB))
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
The allowed child elements include <tt>evaluator-class</tt>. At most one <tt>xel-config</tt> element is allowed for each <tt>zk.xml</tt>.
+
The allowed child elements include <code>evaluator-class</code>. At most one <code>xel-config</code> element is allowed for each <code>zk.xml</code>.
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 11: Line 11:
  
 
== The evaluator-class Element ==
 
== The evaluator-class Element ==
[Default: <javadoc>org.zkoss.xel.el.ELFactory</javadoc> if run under Java 1.4]
+
  [Default: <javadoc>org.zkoss.xel.zel.ELFactory</javadoc>]
  [Default: <javadoc>org.zkoss.xel.zel.ELFactory</javadoc> if run under Java 1.5 or above]
 
  
 
It specifies the class used to evaluate XEL (Extensible Expression Language) expressions. The specified class must implement the <javadoc type ="interface">org.zkoss.xel.ExpressionFactory</javadoc> interface.
 
It specifies the class used to evaluate XEL (Extensible Expression Language) expressions. The specified class must implement the <javadoc type ="interface">org.zkoss.xel.ExpressionFactory</javadoc> interface.
  
If not specified and you are running your ZK application under Java 1.4, ZK uses the XEL implementation from ZK Commons EL (<tt>zcommons-el.jar</tt>), which is a performance-enhanced version of Apache Commons EL.
+
Since ZK 6, if not specified, ZK uses the new XEL implementation from the ZK EL Library (i.e., <code>zel.jar</code>), which supports new features seen in <i>Unified Expression Language 2.2</i> such as method calls and l-value. If ZK cannot find the <code>zel.jar</code> in your class-path, ZK will degrade to use the original ZK Commons EL(<code>zcommons-el.jar</code>).
 
 
Since ZK 5.5, if not specified and you are running your ZK application under Java 1.5 or above, ZK uses the new XEL implementation from The ZK EL Library(<tt>zel.jar</tt>), which supports new features seen in <i>Unified Expression Language 2.2</i> such as method calls and l-value. If ZK cannot find the <tt>zel.jar</tt> in your class-path, ZK will degrade to use the original ZK Commons EL(<tt>zcommons-el.jar</tt>).
 
  
 
If your Web server uses another implementation, you can do one of the following:
 
If your Web server uses another implementation, you can do one of the following:
  
# If you prefer the implementation based on Apache JSP 2.1 EL, you have to specify the <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> class. If the Web server doesn't support Apache JSP 2.1 EL, you have to copy <tt>el-api.jar</tt> (JSP 2.1 API<ref>Required only if you are using the Web server that supports only JSP 2.0.</ref>) and <tt>jasper-el.jar</tt> (Apache's implementation) to your Web application.
+
# If you prefer the implementation based on Apache JSP 2.1 EL, you have to specify the <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> class. If the Web server doesn't support Apache JSP 2.1 EL, you have to copy <code>el-api.jar</code> (JSP 2.1 API<ref>Required only if you are using the Web server that supports only JSP 2.0.</ref>) and <code>jasper-el.jar</code> (Apache's implementation) to your Web application.
# If you prefer the implementation based on Apache Commons EL (JSP 2.0 EL), you have to specify the <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> class. If the Web server doesn't support Apache Commons EL, you have to copy <tt>commons-el.jar</tt> to your Web application.
+
# If you prefer the implementation based on Apache Commons EL (JSP 2.0 EL), you have to specify the <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> class. If the Web server doesn't support Apache Commons EL, you have to copy <code>commons-el.jar</code> to your Web application.
# If you want a different implementation, you can extend from <javadoc>org.zkoss.xel.el.ELFactory</javadoc> or <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> by simply overriding the <tt>newExpressionEvaluator</tt> method. Of course, if you prefer, you can implement the <javadoc type="interface">org.zkoss.xel.ExpressionFactory</javadoc> interface directly.
+
# If you want a different implementation, you can extend from <javadoc>org.zkoss.xel.el.ELFactory</javadoc> or <javadoc>org.zkoss.zkmax.xel.el.ApacheELFactory</javadoc> by simply overriding the <code>newExpressionEvaluator</code> method. Of course, if you prefer, you can implement the <javadoc type="interface">org.zkoss.xel.ExpressionFactory</javadoc> interface directly.
  
  
Line 35: Line 32:
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| 5.5
+
| 6.0.0
 
| Sep. 2011
 
| Sep. 2011
 
| Support those new features seen in Unified Expression Language 2.2 such as method calls and l-value.
 
| Support those new features seen in Unified Expression Language 2.2 such as method calls and l-value.
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
 
|}
 
|}
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 10:34, 19 January 2022


The xel-config Element


The allowed child elements include evaluator-class. At most one xel-config element is allowed for each zk.xml.

 <xel-config>
     <evaluator-class>my.MyExpressionFactory</evaluator-class>
 </xel-config>


The evaluator-class Element

[Default: ELFactory]

It specifies the class used to evaluate XEL (Extensible Expression Language) expressions. The specified class must implement the ExpressionFactory interface.

Since ZK 6, if not specified, ZK uses the new XEL implementation from the ZK EL Library (i.e., zel.jar), which supports new features seen in Unified Expression Language 2.2 such as method calls and l-value. If ZK cannot find the zel.jar in your class-path, ZK will degrade to use the original ZK Commons EL(zcommons-el.jar).

If your Web server uses another implementation, you can do one of the following:

  1. If you prefer the implementation based on Apache JSP 2.1 EL, you have to specify the ApacheELFactory class. If the Web server doesn't support Apache JSP 2.1 EL, you have to copy el-api.jar (JSP 2.1 API[1]) and jasper-el.jar (Apache's implementation) to your Web application.
  2. If you prefer the implementation based on Apache Commons EL (JSP 2.0 EL), you have to specify the ApacheELFactory class. If the Web server doesn't support Apache Commons EL, you have to copy commons-el.jar to your Web application.
  3. If you want a different implementation, you can extend from ELFactory or ApacheELFactory by simply overriding the newExpressionEvaluator method. Of course, if you prefer, you can implement the ExpressionFactory interface directly.


Notes

  1. Required only if you are using the Web server that supports only JSP 2.0.

Version History

Version Date Content
6.0.0 Sep. 2011 Support those new features seen in Unified Expression Language 2.2 such as method calls and l-value.



Last Update : 2022/01/19

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