0

ive been searching for the answer but so far haven't found something that works for me.

My java project has several Beans set with a variety of view / request scope and several XHTML pages which hold all my primefaces components.

What I want to do is when the log off button is clicked all the backing beans are cleared down, the XHTML components reset to default and the user is redirected to the login screen. I have so far managed to clear down the beans using: FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("Mybeanname"); and set up a navigation rule to redirect them to the login screen, all good so far but if you type in a URL of one of the previous pages (or press the browser back button) the page loads and displays what was previously being viewed, presumably the components are caching the information, my question is how do I also clear the xhtml components down so if a previous URL is entered no information will be displayed.

eyebonk
  • 67
  • 10

1 Answers1

0
  1. It's to avoid browser to cache smth. Avoid back button on JSF web application
  2. "but if you type in a URL of one of the previous pages" Maybe you need some security features(Spring security or "Home Based" security(simple filter)) to deny unauthorized access.
Community
  • 1
  • 1
Dmitry
  • 25
  • 4