When using Servlet/JSP, we get HttpSession from HttpServletRequest, now that I develop an application using JSF/JPA/EJB, I don't know how to set attribute in session (for login exactly) and how to get them, any help.
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(true);
session.setAttribute("att", att);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With