All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.jhonsapp.util.jsf.session.SessionFacesUtil Maven / Gradle / Ivy

Go to download

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