You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are trying to access properties of a Java-bean implementing the Map interface with an EL-expression like "#{bean.property}" which always yields null. Is this a bug or is it specified? Please see the following testcase for details.
public class ElTestCase {
private ELProcessor elProcessor;
@Before
public void before() {
elProcessor = new ELProcessor();
TestMapWithProperty test = new TestMapWithProperty("hello");
test.put("entry", "world");
elProcessor.defineBean("test", test);
}
@Test
public void property() {
// fails because the expression evaluates to null
assertThat( elProcessor.eval("test.property"), is("hello") );
}
@Test
public void property_II() {
// fails because the expression evaluates to null
assertThat( elProcessor.eval("test['property']"), is("hello") );
}
@Test
public void entry() {
// success
assertThat( elProcessor.eval("test.entry"), is("world") );
}
public static class TestMapWithProperty extends HashMap<String, String> {
private String property;
public TestMapWithProperty(String property) {
this.property = property;
}
public String getProperty() {
return property;
}
}
}
Hello all,
we are trying to access properties of a Java-bean implementing the Map interface with an EL-expression like "#{bean.property}" which always yields null. Is this a bug or is it specified? Please see the following testcase for details.
The EL-Implementation we are using is