Search code examples
jsf-2http-request-parameters

how to include only part of request params into url?


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


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>