Whats the best way of sending parameters between pages?

后端 未结 3 1903
情话喂你
情话喂你 2021-01-06 14:11

We are using JSF in our project (im pretty new to it) were every page have a back bean Java file.

In order to move (redirect) from one page to another, i need to put

3条回答
  •  梦毁少年i
    2021-01-06 14:48

    Make your managed-bean session scoped.
    If you are using MyFaces you can use PageFlowScope. If using Seam then use Conversation scope.
    If pageflowscope or conversation scope is not available, then use session scoped beans. In addition you can use PhaseListener to initialize or execute specific methods before the page gets called. In you case if the flow is page1 -> page2 -> page3, then initialize the session scoped bean in PhaseListener if page1 gets called.
    I'll update with more info if you need.

提交回复
热议问题