[ 
http://issues.apache.org/jira/browse/MYFACES-623?page=comments#action_12330652 
] 

Bill Dudney commented on MYFACES-623:
-------------------------------------

OK, I've found the problem but I'm not sure there is an easy fix.

getType on PropertyResolverImpl returns String (since that is what is in the 
Map currently) which is returned to the ValueBindingImpl on line 269. Which is 
passed to the coerce method. That is in turn invoking a coersion to String on 
the Foo object (via org.apache.commons.el.Coercions.coerce). I think that is 
calling toString on the object passed in.

I think we could return null from the PropertyResolverImpl.getType method if 
the 'base' is a Map since a Map will accept any type and does not need to have 
things converted. If a null type is passed into coerce on the ValueBindingImpl 
it will simply return the value passed in (Foo in Sean's case and the Integer 
in the test above).

Thoughts?

> setValue() method of ValueBindingImpl does not behave properly
> --------------------------------------------------------------
>
>          Key: MYFACES-623
>          URL: http://issues.apache.org/jira/browse/MYFACES-623
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.0
>     Reporter: sean schofield
>  Attachments: MYFACES-623.patch
>
> According to section 5.1.4 of the specification (p. 5-4) ...
> If you have #{expr-a[value-b]}  where value-a is a Map then ...
> call value-a.put(value-b, newValue).
> The MyFaces implementation is coercing newValue into String which is 
> incorrect behavior.  
> NOTE: I discovered the problem while using a bean that was programatically 
> added to the session map.  So there is is no class defined in 
> faces-config.xml.  I don't think this should matter but I thought I would 
> mention it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to