Re: Conversation Context not active when method called on conversation
Splash › Forums › PrettyFaces Users › Conversation Context not active when method called on conversation › Re: Conversation Context not active when method called on conversation
How to destroy @ViewScoped bean before redirecting to new page by <pretty:link>?
Please note that <pretty:link> actually doesn’t redirect. It just renders a plain
<a> HTML link. If you click it, the browser will simply send a GET request for the new page.
The real problem is in @ViewScoped bean. It is not destroyed after I redirect to new view. Therefore user can click back button of browser and see my page not working well, because @ViewScoped bean was not instantiated again when user clicked back button.
I don’t think it is a good idea to destroy a @ViewScoped bean. I don’t see any reason for this. You cannot prevent the user from clicking the back button and trying to resubmit a form on the previous page. You application should be able to deal with such a case.
The pattern is:
This pattern works very well but not when I need to redirect user from my page forums.jsf to forum.jsf HAVING this pattern displayed in browser.
What you are trying here will not work. You will have to use a pattern like described in this section of the documentation:
To sum my thoughts up: I think that your pages are very strongly coupled which is not good if you are using PrettyFaces. PrettyFaces promotes loosely coupled URLs that work independent from each other. You should have a deeper look at the first sections of the documentation which explain this in detail.