This is a way to get the parameters of the URL
link
Parameter parameterId = value 100.
1.- You must add the tag <f:viewParam>
within <f:metadata>
example:
<f:metadata>
<f:viewParam name="parametroId" value="#{manageBean.parametroId}" />
</f:metadata>
The manageBean.parameterId attribute stores the value obtained by URL.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head></h:head>
<f:metadata>
<f:viewParam name="parametroId" value="#{manageBean.parametroId}"/>
</f:metadata>
<body>
//Cuerpo...
</body>
</html>
And from a ManageBean accessing the context of the application would be as follows:
FacesContext facesContext = FacesContext. getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
Map params = externalContext.getRequestParameterMap();
Integer almacenaParametroObtenido = new Integer((String) params.get("parametroId" ));