Whats the best way of sending parameters between pages?

后端 未结 3 1884
情话喂你
情话喂你 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条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 14:43

    I'm only starting out with JSF too to be honest, but I thought you can save managed beans in the session scope, thus being able to access the bean on each request? You can also save the state client-side avoiding nastiness about session stickyness and stuff.

    So you could save the data you are currently passing as request parameters in a session-scoped managed bean, and it will be available to any requests in that user's session, destroyed when the session times out or is deliberately invalidated (say on user logout).

    I don't think JSF currently supports conversation state which I think might be the exact solution to your problem, maybe a session scoped managed bean would be the pragmatic solution?

提交回复
热议问题