Why are expired @ViewScoped beans not destroyed until the session expires

前端 未结 1 1938
轻奢々
轻奢々 2020-12-06 18:39

I\'m using Mojarra 2.2.4 on GlassFish 4 with Java 7.

As I understand from BalusC\'s answer to How and when is a @ViewScoped bean destroyed in JSF?, @ViewScoped beans

相关标签:
1条回答
  • 2020-12-06 19:10

    I was able to find a clean work-around by using the OmniFaces @ViewScoped annotation (org.omnifaces.cdi.ViewScoped) instead of the standard @ViewScoped (javax.faces.view.ViewScoped).

    The OmniFaces ViewScoped correctly destroys the beans as soon as they expire.

    See here for more details: http://showcase.omnifaces.org/cdi/ViewScoped

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