Question

I'm passing 2 parameters through a h:link like this:

<h:link outcome="index" value="index" >
   <f:param name="a" value="#{bean.a}"  />
   <f:param name="b" value="#{bean.b}"  />
</h:link>

In this case both params are shown in the url. How can I achieve that only param a and not b is shown in the url? Thanks

Was it helpful?

Solution

If you want only one param to be shown in url, you need to pass only one. As it is a GET request(because it is a link), you can't restrict parameters from being shown in the url

<h:link outcome="index" value="index" >
   <f:param name="a" value="#{bean.a}"  />
</h:link>

OTHER TIPS

if you do not need your param to be shown in the URL,then use another method to save it rather than f:param method, save it in the Flash scope for example then restore it in your managed bean

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top