
br.com.jhonsapp.util.jsf.session.SessionFacesUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of util-jsf Show documentation
Show all versions of util-jsf Show documentation
This project provides useful classes that facilitate the construction of new components web.
The newest version!
package br.com.jhonsapp.util.jsf.session;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
/**
* Class responsible for retrieving user session information.
*
* @author Jhonathan Camacho
*/
public class SessionFacesUtil {
/**
* Gets the session identifier.
*
* @return the identifier.
*/
public static String getSessionId() {
FacesContext context = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
return session.getId();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy