Use of JSTL/core tags screws up ViewScoped Bean

前端 未结 1 1836
心在旅途
心在旅途 2020-12-22 00:36

I think I have run into a bug in Mojarra 2.1.0. Maybe I missed something but damned if I can see it.

I rely a lot of @ViewScoped beans to save state whilst the brows

相关标签:
1条回答
  • 2020-12-22 01:35

    This is a known "bug": issue 1665. It's a chicken-egg issue with regard to partial state saving.

    In your case, however, you could also just use <ui:repeat>.

    <ui:repeat value="#{testStuff.stuff}" var="x">
        <h:outputText value="#{x}" />
    </ui:repeat>
    

    Your best bet is to try to avoid JSTL tags when using @ViewScoped. The only alternative is to disable partial state saving by a context param in web.xml:

    <context-param>
        <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
        <param-value>false</param-value>
    </context-param>
    

    But it makes the views more memory hogging.

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