JSF 1.2 - iterate over a Map that contains Collections

前端 未结 1 900
花落未央
花落未央 2021-01-18 05:48

Using JSF 1.2 and JSP....

Is it possible to iterate over a Map whose values contain Collections?

I have a Map that looks li

1条回答
  •  独厮守ぢ
    2021-01-18 06:37

    JSF doesn't have any component which can iterate over a Map. Only the JSTL can iterate over a Map. Each iteration gives you a Map.Entry back which in turn has getKey() and getValue() methods. You can in turn use a to iterate over the map value.

    
        

    Key:


    Update this works only when you're using JSTL 1.2. This fails in JSTL 1.1 because #{} is not recognized in JSTL 1.1 tags and hence you're forced to use ${}, but this in turn fails in the nested JSF components because they accept #{} only. You'd basically need to fall back to "plain" JSP/HTML in that entire piece of code, or, better, grab Tomahawk's .

    0 讨论(0)
提交回复
热议问题