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

有帮助吗?

解决方案

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>

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top