Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values of f:param for a h:link will be put in the request parameter map #246

Open
balta3 opened this issue Nov 11, 2016 · 4 comments
Open

Comments

@balta3
Copy link
Contributor

balta3 commented Nov 11, 2016

See the following example:

<h:outputText value="before: #{param}" />
<h:link outcome="/page.xhtml">
    <f:param name="linkparam" value="test123" />
    Link
</h:link>
<h:outputText value="after: #{param}" />

The output of the parameter map will contain the parameter linkparam of the link generation after the link. This makes it inpossible to get the original parameter map of this request.

@chkal
Copy link
Member

chkal commented Nov 12, 2016

Could you please share more details about your setup. Especially which dependencies you included in your project, which version you are using and the rule you are using for /page.xhtml.

@balta3
Copy link
Contributor Author

balta3 commented Nov 14, 2016

I've created a very simple test project (Maven, 1 class and 2 xhtml files)
You can see the wrong behaviour on /page1, /page2 shows expected behaviour

rewrite-bug-246.zip

@chkal
Copy link
Member

chkal commented Nov 15, 2016

Hey. Thanks a lot for providing the sample application. I was able to reproduce the issue you described very easily with it. And I agree that the current behavior isn't correct.

Unfortunately this bug is very hard to track down. I spent over 1.5 hours trying to identify the root cause and I'm still not sure what is going on. And fixing it may even have a large impact on the code base. Not sure about that. It may be a conceptional problem.

To be honest, I don't think that I'll be able to fix it on my own any time soon. Unfortunately development of Rewrite has slowed down because there are only two developers and both @lincolnthree and I don't find much time for Rewrite any more.

Some notes for people who want to spend more time on this:

  • Join/Path create two way data bindings to the request parameter maps (see Path.setParameterStore())
  • These bindings seems to get submitted even for the outbound rewriting case.
  • It does not happen if you define your rules like this: Join.pathNonBinding()...
  • Maybe bindings should not be submitted at all in the outbound rewriting case? This would be something to fix in DefaultHttpRewriteProvider.rewriteOutbound. May have a large impact. Not sure about the binding details. I guess @lincolnthree knows more about that.

@lincolnthree
Copy link
Member

Rewrite is supposed to ignore these special parameters, I'll have to take a closer look. Thanks for submitting this and sorry for the delay! As Christian mentioned, we're both pretty busy at the moment, but I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants