JSF url rewriting

I am using JSF and I want to avoid the same session sharing two tabs in my browser. I believe the easy way is to force url rewriting instead of using cookies.

Can anyone tell me how I can get the URL rewriting with JSF?

Thank.

Stéphane

0


source to share


1 answer


I want the same session to not share 2 tabs in my browser

Sorry, but that doesn't make sense. This is not something that you can control from the server side. All browsers use the same session in all open tabs / windows (expect anonymous tabs / windows like Chrome Ingognito with Ctrl + Shift + N). This is how all browsers work and is completely out of your control.

If you have a problem with this, you should absolutely solve it differently than trying to disable session sharing across multiple browser tabs / windows (which is simply not possible). It looks like you are not storing the request correctly or viewing the scoped data in the session bean. You shouldn't be doing this. You must store the data with the request in the request scope of the bean and view the scoped data in the scope of the bean. Session scope should only be used for session-scoped data, such as the user's login and preferences such as language preferences.



I think the viewport is what you are looking for; it lives as long as you interact with the same view (read: same browser windows / tabs) using postbacks, and it won't be used in other browser windows / tabs.

See also:

+2


source







All Articles