<h:commandButton id="testButton" value="Test Button" |
Here’s the console output:public void someMethod(String param) {
System.out.println("param: " + param);
}
| param: someString |
The following stack has been used for testing:
Apache Tomcat 6.0.26
MyFaces 2.0.2
jdk1.6.0_18
Tomcat 6 doesn’t come with EL (Expression Language) 2.2 and to enable it, follow these steps:
Replace el-api.jar with GlassFish EL 2.2 implementation (el-api-2.2.jar and el-impl-2.2.jar) in the Tomcat “lib” folder. These could be downloaded from the following links:
http://download.java.net/maven/2/org/glassfish/web/el-impl/2.2/el-impl-2.2.jar
http://download.java.net/maven/2/javax/el/el-api/2.2/el-api-2.2.jar
In the web.xml, add the following depending on the implementation:
For MyFaces using Sun’s (GlassFish) EL 2.2, add:
<context-param> |
For Mojarra, add:
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
If you use Apache’s EL 2.2 implementation, add this to the param-value: org.apache.el.ExpressionFactoryImpl
References:
http://wiki.apache.org/myfaces/HowToEnableEl22
Source: http://code2inspire.wordpress.com/2010/11/05/how-to-enable-el-2-2-on-tomcat-6/
Không có nhận xét nào:
Đăng nhận xét