Session scoped managed bean and actionListener

后端 未结 1 532
别跟我提以往
别跟我提以往 2020-12-18 05:32

I want to do multiple actions on different managed beans with the same button, one being scoped session and the other request. In my example I use the same bean for both.

相关标签:
1条回答
  • 2020-12-18 05:46

    That's expected behaviour. The <f:actionListener type> creates and gets its own bean instance on every declaration. It does not reuse the same session scoped bean which is managed by JSF.

    You need to use binding instead to bind to the already-created session scoped bean instance.

    <f:actionListener binding="#{controller}" />
    
    0 讨论(0)
提交回复
热议问题