how to keep search parameters 3 pages deep without having to make entire bean session scoped?

StackOverflow https://stackoverflow.com/questions/18276159

سؤال

I'm curious what the best way is to handle this scenario:

Let's say i have a search page, a results page, an edit page, and then a 4th page. The user searches on some criteria, gets redirected to a results page, then on the results page the user can click edit to edit one of the results, and then on the edit page they can also do something else which redirects to a 4th page.

I also have breadcrumbs from the edit page and the 4th page to return to the results page. Currently I'm passing everything through the url when going forward through pages (search, results, edit, 4th) and using <f:viewParam>s, but it's not working well for breadcrumbs.

What is the best way for handling this scenario? I'd really like to not have to set the entire bean to session scope. Should i be using a managed property that is set to session scope?

هل كانت مفيدة؟

المحلول 2

I ended up creating a session scoped bean that just holds the search criteria and then i inject that bean as a ManagedProperty into my ViewScoped backing beans.

نصائح أخرى

I think your problem is related more to how you do your navigation than to how you store your result. You could yous forwarding instead of redirecting to direct users to another page thus ensuring your requests object are not destroyed.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top