I use Apache MyFaces 2.0.2 on WebSphere Application Server 8.
How do I get the key of a DualTreeBidiMap in a in JSF 2.0?
The DualTreeBidiMap provides a getKey(Object Value) or get(Object Key) method.
I have the Value in another ManagedBean, so I want to print out the Key for this Value with EL.
I’ve tryed something like this:
<h:outputText value="#{bean1.dualTreeBidiMap.key(bean2.value)}" />
But this does not work.
Since your value attribute is a method expression and not a value expression, the correct syntax should be:
The
getprefix needs only to be omitted for value expressions (for fields with a parameterless getter).Note that method invocation with parameters is only possible since EL 2.2. I am not using WAS 8, but a quick Google search revealed that it should support EL 2.2.