[
https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637238#action_12637238
]
Leonardo Uribe commented on MYFACES-2006:
-----------------------------------------
The original code looks like this:
public String getTabindex()
{
if (_tabindex != null) return _tabindex;
ValueBinding vb = getValueBinding("tabindex");
return vb != null ? _ComponentUtils.getStringValue(getFacesContext(),
vb) : null;
}
and the method getStringValue looks like this:
static String getStringValue(FacesContext context, ValueBinding vb)
{
Object value = vb.getValue(context);
if(value == null)
{
return null;
}
return value.toString();
}
The effect described here comes from the use of value.toString(). If receives a
EL expression that returns something different to String (in this case Integer)
the effect of toString() is convert the value, so the component can handle it
correctly.
The introduction of component generation using myfaces-builder-plugin,
introduce without notice the change described. (It's more, there was a release
candidate for 1.1.6 release before the real release) . In fact, this is not a
blocker issue, because there exists a valid solution for that (change
signature on the bean to return String instead). In jsf 1.2, this behavior is
not present so when you go from 1.1 to 1.2 the same problem occur.
Here comes the difficult part: If in jsf 1.2 this behavior is not present, but
on previous jsf 1.1 myfaces releases this is valid, Should we change this on
1.1?
If no objections I'll lower the priority of this issue to major.
> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
> Key: MYFACES-2006
> URL: https://issues.apache.org/jira/browse/MYFACES-2006
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 1.1.6
> Reporter: Paris Holley
> Priority: Blocker
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is
> upgraded to 1.1.6 classcast exceptions are thrown when elements such as
> HtmlInputText try to access getTabIndex through an EL expression that returns
> an "int". Though the spec states that the EL expression should return a
> string, this was not a problem in the previous version. If tag attributes are
> more strict in the latest release, it would help to have stated so in the
> release notes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.