myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Dudney (JIRA)" <>
Subject [jira] Commented: (MYFACES-623) setValue() method of ValueBindingImpl does not behave properly
Date Tue, 27 Sep 2005 22:33:48 GMT
    [ ] 

Bill Dudney commented on MYFACES-623:

Hi Sean,

I think I've found a reproducable test case;

	public void testSetValueSimpleBeanInRequestMapWithInitialValue() {
		Map map = new HashMap();
		String initialValue = "hello world";
		map.put("baz", initialValue);
		TestBean bean = new TestBean(map);
		facesContext.getExternalContext().getRequestMap().put("bean", bean);
		ValueBinding binding = application.createValueBinding("#{['baz']}");
		assertEquals(initialValue, binding.getValue(facesContext));
		Integer value = new Integer(14);
		binding.setValue(facesContext, value);
		assertEquals(14, ((Integer)binding.getValue(facesContext)).intValue());

thows a class cast exception on the final assert.

> setValue() method of ValueBindingImpl does not behave properly
> --------------------------------------------------------------
>          Key: MYFACES-623
>          URL:
>      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:
For more information on JIRA, see:

View raw message