Re: [jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
Yes, good idea. It is just this part of the code has a long history. In theory, the call to encodeActionURL from encodeBookmarkableURL should not be done, because you are just calling the same code (encodeURL) twice, but the spec demands this call. 2016-06-20 16:35 GMT+02:00 Mike Kienenberger: > If the spec is ambiguous, and there is a use case for both possibilities, > wouldn't it make sense to support both and use a context parameter to > enable which behaviour is enabled? > > On Mon, Jun 20, 2016 at 8:56 AM, Leonardo Uribe (JIRA) < > dev@myfaces.apache.org> wrote: > >> >> [ >> https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339443#comment-15339443 >> ] >> >> Leonardo Uribe commented on MYFACES-4052: >> - >> >> I checked the code step by step, and it looks like the call to >> ViewHandler.getBookmarkableURL(...) before the end calls to >> ExternalContext.encodeActionURL(...), which according to the spec: >> >> "... Return the input URL, after performing any rewriting needed to >> ensure that it will correctly identify an addressable action in the current >> application. ..." >> >> In fact there is a rewriting there, which put all parameters in a map >> again, but in that moment the previous param is lost. >> >> JSF 2.2 section 7.6.2 enforces call encodeActionURL at the end of >> getBookmarkableURL. >> >> Other problem I see is in the RFC 3986 there is no mention about use a >> query param with multiple values, so we are in a case where this detail is >> not specified, even if it is used somehow. >> >> I can remember of some issues related to encodeActionURL, where a param >> was written on the url more than once and the code is there is used to >> clean the URL, as the javadoc says. It should be fixed at spec level, so >> I'll close it again as won't fix. >> >> > Multiple with same name encodes only last one in link URL >> > --- >> > >> > Key: MYFACES-4052 >> > URL: https://issues.apache.org/jira/browse/MYFACES-4052 >> > Project: MyFaces Core >> > Issue Type: Bug >> >Affects Versions: 2.2.10 >> > Environment: TomEE 7.0.0 >> >Reporter: Bauke Scholtz >> >Assignee: Leonardo Uribe >> > >> > Consider: >> > {code} >> > >> > >> > >> > >> > {code} >> > MyFaces 2.2.10 renders only last one in link URL instead of both. >> >> >> >> -- >> This message was sent by Atlassian JIRA >> (v6.3.4#6332) >> > >
Re: [jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
If the spec is ambiguous, and there is a use case for both possibilities, wouldn't it make sense to support both and use a context parameter to enable which behaviour is enabled? On Mon, Jun 20, 2016 at 8:56 AM, Leonardo Uribe (JIRA) < dev@myfaces.apache.org> wrote: > > [ > https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339443#comment-15339443 > ] > > Leonardo Uribe commented on MYFACES-4052: > - > > I checked the code step by step, and it looks like the call to > ViewHandler.getBookmarkableURL(...) before the end calls to > ExternalContext.encodeActionURL(...), which according to the spec: > > "... Return the input URL, after performing any rewriting needed to ensure > that it will correctly identify an addressable action in the current > application. ..." > > In fact there is a rewriting there, which put all parameters in a map > again, but in that moment the previous param is lost. > > JSF 2.2 section 7.6.2 enforces call encodeActionURL at the end of > getBookmarkableURL. > > Other problem I see is in the RFC 3986 there is no mention about use a > query param with multiple values, so we are in a case where this detail is > not specified, even if it is used somehow. > > I can remember of some issues related to encodeActionURL, where a param > was written on the url more than once and the code is there is used to > clean the URL, as the javadoc says. It should be fixed at spec level, so > I'll close it again as won't fix. > > > Multiple with same name encodes only last one in link URL > > --- > > > > Key: MYFACES-4052 > > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > > Project: MyFaces Core > > Issue Type: Bug > >Affects Versions: 2.2.10 > > Environment: TomEE 7.0.0 > >Reporter: Bauke Scholtz > >Assignee: Leonardo Uribe > > > > Consider: > > {code} > > > > > > > > > > {code} > > MyFaces 2.2.10 renders only last one in link URL instead of both. > > > > -- > This message was sent by Atlassian JIRA > (v6.3.4#6332) >
[jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339443#comment-15339443 ] Leonardo Uribe commented on MYFACES-4052: - I checked the code step by step, and it looks like the call to ViewHandler.getBookmarkableURL(...) before the end calls to ExternalContext.encodeActionURL(...), which according to the spec: "... Return the input URL, after performing any rewriting needed to ensure that it will correctly identify an addressable action in the current application. ..." In fact there is a rewriting there, which put all parameters in a map again, but in that moment the previous param is lost. JSF 2.2 section 7.6.2 enforces call encodeActionURL at the end of getBookmarkableURL. Other problem I see is in the RFC 3986 there is no mention about use a query param with multiple values, so we are in a case where this detail is not specified, even if it is used somehow. I can remember of some issues related to encodeActionURL, where a param was written on the url more than once and the code is there is used to clean the URL, as the javadoc says. It should be fixed at spec level, so I'll close it again as won't fix. > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz >Assignee: Leonardo Uribe > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Reopened] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leonardo Uribe reopened MYFACES-4052: - > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz >Assignee: Leonardo Uribe > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339333#comment-15339333 ] Leonardo Uribe commented on MYFACES-4052: - Please note it is just an interpretation of the spec, it is not "something carved on a stone". The important lines of code are on OutcomeTargetUtils.getOutcomeTargetHref(...). But looking in the code, it looks like this: {code:java} List validParams = getValidUIParameterChildren( facesContext, component.getChildren(), true, false); if (validParams.size() > 0) { parameters = new HashMap(); } for (int i = 0, size = validParams.size(); i < size; i++) { UIParameter param = validParams.get(i); String name = param.getName(); Object value = param.getValue(); if (parameters.containsKey(name)) { parameters.get(name).add(value.toString()); } else { List list = new ArrayList(1); list.add(value.toString()); parameters.put(name, list); } } {code} Maybe two UIParameter instances with the same name can be interpreted as the same source, but as I see it, it is not clear in this case what to do. I'll reopen it, it looks like it is necessary to investigate more about it. > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz >Assignee: Leonardo Uribe > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339278#comment-15339278 ] Bauke Scholtz edited comment on MYFACES-4052 at 6/20/16 10:11 AM: -- You mean, you interpreted the spec as: "if there are multiple values in the **same** source, the latter value must replace all instances of the previous value"? was (Author: balusc): You mean, you interpreted the spec as: "if there are multiple values in the same source, the latter value must replace all instances of the previous value"? > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz >Assignee: Leonardo Uribe > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339278#comment-15339278 ] Bauke Scholtz commented on MYFACES-4052: You mean, you interpreted the spec as: "if there are multiple values in the same source, the latter value must replace all instances of the previous value"? > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz >Assignee: Leonardo Uribe > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MYFACES-4052) Multiple with same name encodes only last one in link URL
[ https://issues.apache.org/jira/browse/MYFACES-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339265#comment-15339265 ] Leonardo Uribe commented on MYFACES-4052: - JSF 2.2 section 7.4.2, before 7.4.2.1 you can see this description: "...Query string parameters may be contributed by three different sources: the outcome (implicit navigation), a nested on the component tag (e.g., , , , ), and view parameters. When a redirect URL is built, whether it be by the NavigationHandler on a redirect case or a UIOutcomeTarget renderer, the query string parameter sources should be consulted in the following order: - the outcome (implicit navigation) - view parameter - nested If a query string parameter is found in two or more sources, the latter source must replace all instances of the query string parameter from the previous source(s). ..." It is the only reference I could found for this case. In summary, f:param behaviour depends on the interpretation of the renderer. In this case, there is not any mention of how f:param must be interpreted by the renderer, but the way how URL links are calculated is defined by the spec by the navigation algorithm. I think this issue should be closed as invalid, because there is a clear mention about how this part should work in the spec and we cannot change that behavior, at least from MyFaces side. This change should be done at JSF spec level, but I still have doubts about it. There is evidence that ViewHandler.getBookmarkableURL(...) receives a Mapas parameters, but if that so, it looks like f:param could be modified to handle List values. > Multiple with same name encodes only last one in link URL > --- > > Key: MYFACES-4052 > URL: https://issues.apache.org/jira/browse/MYFACES-4052 > Project: MyFaces Core > Issue Type: Bug >Affects Versions: 2.2.10 > Environment: TomEE 7.0.0 >Reporter: Bauke Scholtz > > Consider: > {code} > > > > > {code} > MyFaces 2.2.10 renders only last one in link URL instead of both. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TOBAGO-1569) AJAX should be independent from Multi-Form concept
[ https://issues.apache.org/jira/browse/TOBAGO-1569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15339108#comment-15339108 ] Hudson commented on TOBAGO-1569: FAILURE: Integrated in Tobago 3.0.x #395 (See [https://builds.apache.org/job/Tobago%203.0.x/395/]) TOBAGO-1569: AJAX should be independent from Multi-Form concept (lofwyr: [http://svn.apache.org/viewvc/?view=rev=1749268]) * tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java * tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ExecuteController.java * tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/5-java/20-ajax-execute * tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/5-java/20-ajax-execute/ajax-execute.test.js * tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/5-java/20-ajax-execute/ajax-execute.xhtml > AJAX should be independent from Multi-Form concept > -- > > Key: TOBAGO-1569 > URL: https://issues.apache.org/jira/browse/TOBAGO-1569 > Project: MyFaces Tobago > Issue Type: Sub-task > Components: Core >Reporter: Udo Schnurpfeil >Assignee: Udo Schnurpfeil > Fix For: 3.0.0-beta-1, 3.0.0 > > > The AJAX execute="id" components should be executed independent from the > multi-form state. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (TOBAGO-1569) AJAX should be independent from Multi-Form concept
Udo Schnurpfeil created TOBAGO-1569: --- Summary: AJAX should be independent from Multi-Form concept Key: TOBAGO-1569 URL: https://issues.apache.org/jira/browse/TOBAGO-1569 Project: MyFaces Tobago Issue Type: Sub-task Reporter: Udo Schnurpfeil Assignee: Udo Schnurpfeil The AJAX execute="id" components should be executed independent from the multi-form state. -- This message was sent by Atlassian JIRA (v6.3.4#6332)