Author: lfryc(a)redhat.com
Date: 2010-07-10 15:36:47 -0400 (Sat, 10 Jul 2010)
New Revision: 17856
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java
Log:
fixed obtaining instance of ExpressionFactory from current context (wasn't compatible
with Tomcat 6.0.26 implementation)
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java 2010-07-10
19:36:21 UTC (rev 17855)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java 2010-07-10
19:36:47 UTC (rev 17856)
@@ -109,7 +109,7 @@
/**
* Constructor for class Attributes.
- *
+ *
* @param componentClass
* class object of a JSF component whose attributes will be stored
* @param beanClass
@@ -121,7 +121,7 @@
/**
* Constructor for class Attributes.
- *
+ *
* @param behaviorClass
* class object of a JSF behavior whose attributes will be stored
* @param beanClass
@@ -352,13 +352,14 @@
// if no select options for "action" are defined in property file and
it is an EL expression
if (!hasSelectOptions("action") && isStringEL(outcome)) {
- method = ExpressionFactory.newInstance().createMethodExpression(elContext,
outcome, String.class, new Class[0]);
+ method = getExpressionFactory().createMethodExpression(elContext, outcome,
String.class, new Class[0]);
return (String) method.invoke(elContext, null);
}
// if select options for "action" are defined in property file
if (hasSelectOptions("action")) {
- method = ExpressionFactory.newInstance().createMethodExpression(elContext,
getMethodEL(outcome), String.class,
+ method =
+ getExpressionFactory().createMethodExpression(elContext,
getMethodEL(outcome), String.class,
new Class[0]);
return (String) method.invoke(elContext, null);
@@ -390,14 +391,16 @@
// if no select options for "actionListener" are defined in property
file and it is an EL expression
if (!hasSelectOptions("actionListener") &&
isStringEL(listener)) {
- method = ExpressionFactory.newInstance().createMethodExpression(elContext,
listener, void.class,
+ method =
+ getExpressionFactory().createMethodExpression(elContext, listener,
void.class,
new Class[]{ActionEvent.class});
method.invoke(elContext, new Object[]{event});
}
// if select options for "actionListener" are defined in property file
if (hasSelectOptions("actionListener")) {
- method = ExpressionFactory.newInstance().createMethodExpression(elContext,
getMethodEL(listener), void.class,
+ method =
+ getExpressionFactory().createMethodExpression(elContext,
getMethodEL(listener), void.class,
new Class[]{ActionEvent.class});
method.invoke(elContext, new Object[]{event});
}
@@ -460,4 +463,13 @@
attr.setValue(value);
attributes.put(name, attr);
}
+
+ /**
+ * Obtains the ExpressionFactory instance from current context.
+ *
+ * @return the ExpressionFactory instance from current context
+ */
+ private ExpressionFactory getExpressionFactory() {
+ return
FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
+ }
}
Show replies by date