I believe there are 2 ways to get the parameters from the URL in JSF.
One being in the bean:
Map<String, String> params =FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap();
String parameterOne = params.get("parameterOne");
and the other one being in the facelets page
<f:metadata>
<f:viewParam name="parameterOne" value="#{bean.parameterOne}"/>
</f:metadata>
Obviously the latter one will require a field in the class and getter / setter for it.
Besides that, what are the differences between these 2 different approaches? Which one should be preferred?
I think this may help: Get Request and Session Parameters and Attributes from JSF pages
In fact, there should be a query:
<h:outputText value="#{param['id']}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With