Tuesday 20 May 2008

DataTableTag broken in Sun's JavaServer Faces implementation (1.2-b20-FCS)

Error
The method setVar(String) in the type DataTableTag is not applicable for the arguments (JspValueExpression)

while using
Tomcat: 6.0.16
JSF: Sun's JavaServer Faces implementation (1.2-b20-FCS)

Cause
The root cause of this issue is, the definition of the "var" attribute of the dataTable tag in "html_basic.tld" does not match with signature of "setVar" method on com.sun.faces.taglib.html_basic com.sun.faces.taglib.html_basic.DataTableTag class.

The definition of "var" in the tag lib file is a "deferred-value" of type "java.lang.String"

which tells that JSP compiler that this is a "ValueExpression", hence it generates the following code

setVar(new org.apache.jasper.el.JspValueExpression("/HelloWorld.jsp(12,1) 'currentItem'",_el_expressionfactory.createValueExpression("currentItem",java.lang.String.class))

where as, the DataTableTag class expects setVar(String).

Workaround
Use a previous stable build. I used "jsf-1.2_07-b03-FCS".

6 comments:

Omer said...

Thanks, this has saved me a great deal of grief, the problem is version 1.2-b20-FCS is the default one that is shown when I get forwarded to the jsf download page. I downloaded version 1.2_09-b02-FCS, but that was still broken. I downloaded jsf-1.2_07-b03-FCS and it worked as you said. I wonder if any one has raised this with Sun yet!

Jamie Smith said...

where would I go to get that version of JSF? I am having the same problem with the current version

Mario said...

Muchas gracias, me salvaste!

thanks a lot, you save me!

TunisianBoy said...

Thanks a lot, jsf-1.2_07-b03-FCS is a solution, but i have another solution which is to change your web server to glassfish.
But the first one is better

Unknown said...

jsf-1.2_07-b03-FCS:

https://javaserverfaces.dev.java.net/files/documents/1866/78307/jsf-1_2_07.zip

Anonymous said...

blog is great~~祝你人氣高高~.................................................................