0

I have a page that I access using a GET request. Basically along the lines of https://example.com/SomeView.jsf?id=123&somethingElse=1&evenMore=3

Now I want to stay on this page while cycling through some parameter. I can do something along the lines of:

<h:outputLink value="#{request.requestURI}" >
  <f:param name="id" value="#{request.getParameter('id')}"/>
  <f:param name="somethingElse" value="#{request.getParameter('somethingElse')}"/>
  <f:param name="evenMore" value="#{request.getParameter('evenMore')}"/>
  <f:param name="displayMode" value="#{bean.nextMode}"/>
  Next Display Mode
</h:outputLink>

but I guess there exists a better more idiomatic way of fixing it.

NOTE: It has been suggested that this question is a duplicate of another question that deals with form submits. It is not as clicking the outputLink does not result in a form submit.

Erik I
  • 972
  • 1
  • 11
  • 28
  • Possible duplicate of [Retaining GET request query string parameters on JSF form submit](http://stackoverflow.com/questions/17734230/retaining-get-request-query-string-parameters-on-jsf-form-submit) – Kukeltje Jun 06 '16 at 14:27
  • @Kukeltje: Not a duplicate, I'm using an outputLink. outputLink creates a plain GET-style-link so no form submit happens. That said, -thanks for the link although I'd still like to solve it my way. – Erik I Jun 07 '16 at 05:32
  • 1
    Is this helpful? http://stackoverflow.com/q/13249844 – BalusC Jun 14 '16 at 14:39
  • @BalusC possibly yes. Will try. – Erik I Jun 14 '16 at 16:31

0 Answers0