문제

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