views:

34

answers:

1

The following link passes query parameters as f:param and they get substituted in Users.page.xml, and these parameters appear as query parameters in the browse URL which we would like to not show to the end user. Is there an alternate mechanism to pass parameters to the entity query bean

<rich:menuItem>
    <s:link value="Users" view="/Users.xhtml">
        <f:param name="gender" value="male" />
    </s:link>
</rich:menuItem>
A: 

With s:link you are doing a GET request, the parameter will be in the URL. To hide the parameter you can change this to a h:commandButton calling an action with the parameter:

<h:commandButton action="#{bean.listUsers('male')}" >
Pere Villega
We have lots of s:link's which actually take you to a List page where all the entities are shown, in the above case all the query parameters are dynamically passed via f:param and set in the page.xml prior to rendering List page. It would be hard to mimic this scenario based on h:commandButton.Showing up query parameters in the browser URL doesn't seem to gel well with many folks, we tried to url re-write some pieces of it, but it didn't help either since it comes up with many parameters if many query parameters are passed on the wire. Would like to know, if there is a simpler way to do this
I would say that it can't be done, as you are doing GET requests and by definition these show the parameters in the URL. You would need to change to POST, which means using s:button or h:commandButton.Of course it may be possible and I just don't know how.
Pere Villega
s:button also seems to be passing the parameters in the URL Is there a different way to resolve this issue.