read parameter from backing bean

Read query string from backing bean  from  Hobione blog


FacesContext context = FacesContext.getCurrentInstance();

  1. Map<String, String> params = context.getExternalContext().getRequestParameterMap();
  2. String ID = params.get(“inputId”);

 FacesContext context = FacesContext.getCurrentInstance();
 Map<String, String> params = context.getExternalContext().getRequestParameterMap();
 String pID = params.get("packageId");

Now ID should have the value 1111

For ADF in faces-config.xml:


<description>Backing bean for tree example. </description>






<value>#{param.packageId}</value> <!–JSF injects query string value from request parameter –>



In, I have a instance variable and getter and setter

view plain
copy to clipboard

private String packageId;

private String packageId;

Caution: Bean scope has to be request otherwise you get a nasty error like this.

view plain
copy to clipboard

javax.faces.FacesException: Problem in renderResponse: Unable to create managed

bean tree. The following problems were found:

– The scope of the object referenced by expression #{param.packageId}, request, is shorter than the

referring managed beans (tree) scope of session note

refer to :