Thursday, October 2, 2008

IllegalArgumentException:argument type mismatch

Code:

Error Message:
2005-01-18 14:34:18 StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch at......

What you wanted to use is the value attribute, not the binding attribute.
Solution:


If you declare the "value" attribute you use "Value Binding" expressions. They are used to refer to properties in your bean.
Example: value="${userBean.userName}" refers to the username property in your userBean instance. Your userBean should have accessors methods for the "userName" property: setUserName(String name) and getUserName()‏

Declaring the "binding" attribute you use "Component Binding" expressions. With this attribute you refer to the entire component instance.
Example:assuming "result" refers to a UIInput component instance: binding="${userBean.result}" Then in your userBean, you would have:
private UIInput result;
public UIInput getResult() {
return result;
}
public void setResult(UIInput result) {
this.result = result);
}

No comments: