put Session Param from JSF FacesContext - Java JSF

Java examples for JSF:Session

Description

put Session Param from JSF FacesContext

Demo Code


import java.util.Map;
import java.util.Map.Entry;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class Main{
    public static void main(String[] argv) throws Exception{
        String key = "java2s.com";
        Object value = "java2s.com";
        putSessionParam(key,value);// w w w.ja  v  a 2 s. com
    }
    public static void putSessionParam(String key, Object value) {
        FacesContext.getCurrentInstance().getExternalContext()
                .getSessionMap().put(key, value);
    }
}

Related Tutorials