get Request Param from JSF FacesContext - Java JSF

Java examples for JSF:FacesContext

Description

get Request 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 name = "java2s.com";
        System.out.println(getRequestParam(name));
    }//from  w  w w .  j a va 2  s  .  c om
    public static String getRequestParam(String name) {
        return FacesContext.getCurrentInstance().getExternalContext()
                .getRequestParameterMap().get(name);
    }
}

Related Tutorials