I have a @ViewScoped
bean with a List<String>
containing plain HTML. I want to iterate over this list and output plain html:
<c:forEach items="#{bean.list}" var="html">
<f:verbatim>#{html}</f:verbatim>
</c:forEach>
That snippet above works well but when the page is refreshed the bean costrunctor is recalled. This issue/bug is known: JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request
So the suggestion is to replace <c:forEach>
with <ui:repeat>
.
<ui:repeat value="#{bean.list}" var="html">
<f:verbatim>#{html}</f:verbatim>
</ui:repeat>
But that doesn't work. I have a blank page. I tried <h:dataTable>
, <a4j:repeat>
and <rich:dataTable>
but nothing to do.
Any solutions?