In the earliest days of using CDI, I go to a long-run page, the conversation is active using faces-redirect = true, so I have a URL like ... myPage.xhtml? cid = 1.
At some point I end the conversation, I mean, should this be a reasonable thing, or can you also use the session area? In any case, I end the conversation, and then the user presses F5, and then, of course, this leads to a "conversation not found" error, since cid = 1 does not exist.
Can anyone suggest a workaround for this problem? I use Steven Verborgh ViewScoped implementation and just use the bean swap area to pass parameters between pages. Therefore, I have, for example, 2 @ViewScoped beans, each of which refers to pages 1 and 2. I @ Insert @ConversationScoped ParameterBean into both kinds of beans. I start (parameter Bean.getConversation (). Begin ()) in the action method called from page 1. In the preRenderView event on page 2, I take a reference to the properties of the Bean parameter on page 2, supporting the bean instance variable and ending the conversation, it executed this work was no longer required.
Except for F5, it works fine. If anyone has any suggestions, I would be grateful, I hope I do not miss something really obvious. I kind of assume that it doesn’t work from the redirect.
Thank.
source
share