I\'m developing a simple project cloud in which a registered user after login can download and upload files. I\'m developing with Eclipse Java EE, JSF and Hibernate. In my p
You need to create a ManagedBean of session scope. On login, you set the user object (that you got from DB) in that ManagedBean. And then, you will be able to access it through all the application.
Alternative way, is to set the user object directly in session:
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
Map sessionMap = externalContext.getSessionMap();
And then:
sessionMap.put("attributeName", whateverYouWantToSaveInSession);
But I would choose the first approach.