I had the same problem and found this when I was looking for a solution to solve the problem. Changing the map was not really an option for me, because it was an automatically generated code, so here's what I did.
I created a managed bean:
package my.bean.tool; import javax.faces.bean.ManagedBean; import javax.faces.bean.ApplicationScoped; @ManagedBean @ApplicationScoped public class Caster { public Caster() { } public int toInt(long l) { return (int) l; } }
Then I just did what in your case would be:
<h:outputLabel value="#{bean.myMap.get(caster.toInt(0))}">
source share