How To Pass a Parameter to JSF Application Using URL String
if you have the following URL:
http://your_server/your_app/product.jsf?id=777
, you access the passing parameter id with the following lines of java code:
FacesContext fc = FacesContext.getCurrentInstance(); String id = (String) fc.getExternalContext().getRequestParameterMap().get("id");
From the page, you can access the same parameter using the predefined variable with name param. For example,
<h:outputText value="#{param['id']}" ></h:outputText>
Comments