sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SLING-7516) ResourceRuntimeExtension: Modified selectors are always stripped after a comma.
Date Mon, 26 Feb 2018 17:17:00 GMT

     [ https://issues.apache.org/jira/browse/SLING-7516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Konrad Windszus updated SLING-7516:
-----------------------------------
    Description: 
Due to the way how the request dispatcher options are serialized into one big string in https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/cd7d67e66f624c66fe88dd208c4d2b8f7e85c8ec/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L214
you cannot use e.g. selectors which contain a comma. This is a problem because currently selectors
are the only way to propagate parameters from one HTL script to another script/servlet (compare
with SLING-7515).

The method {{createDispatcherOptions}} generates from a Map a String where the entries are
separated by {{,}}, i.e. comma. If either the map key or the map value contain a comma itself
the tokenization in https://github.com/apache/sling-org-apache-sling-api/blob/ec3dcf291b26e833b07a1f9c485bbe713a7ad4d5/src/main/java/org/apache/sling/api/request/RequestDispatcherOptions.java#L100
works incorrectly! 

Therefore instead of using the constructor with strings (with very simple/incorrect parsing)
you should rather call put for each option separately.

  was:
Due to the way how the request dispatcher options are serialized into one big string in https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/cd7d67e66f624c66fe88dd208c4d2b8f7e85c8ec/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L214
you cannot use e.g. selectors which contain a comma. This is a problem because currently selectors
are the only way to propagate parameters from one HTL script to another script/servlet (compare
with SLING-7515).

The method {{createDispatcherOptions}} generates from a Map a String where each entry is separated
by {{,}}. If either the map key or the map value contain a comma itself the tokenization in
https://github.com/apache/sling-org-apache-sling-api/blob/ec3dcf291b26e833b07a1f9c485bbe713a7ad4d5/src/main/java/org/apache/sling/api/request/RequestDispatcherOptions.java#L100
works incorrectly! 

Therefore instead of using the constructor with strings (with very simple/incorrect parsing)
you should rather call put for each option separately.


> ResourceRuntimeExtension: Modified selectors are always stripped after a comma.
> -------------------------------------------------------------------------------
>
>                 Key: SLING-7516
>                 URL: https://issues.apache.org/jira/browse/SLING-7516
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting HTL Engine 1.0.48-1.3.1
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Due to the way how the request dispatcher options are serialized into one big string
in https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/cd7d67e66f624c66fe88dd208c4d2b8f7e85c8ec/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L214
you cannot use e.g. selectors which contain a comma. This is a problem because currently selectors
are the only way to propagate parameters from one HTL script to another script/servlet (compare
with SLING-7515).
> The method {{createDispatcherOptions}} generates from a Map a String where the entries
are separated by {{,}}, i.e. comma. If either the map key or the map value contain a comma
itself the tokenization in https://github.com/apache/sling-org-apache-sling-api/blob/ec3dcf291b26e833b07a1f9c485bbe713a7ad4d5/src/main/java/org/apache/sling/api/request/RequestDispatcherOptions.java#L100
works incorrectly! 
> Therefore instead of using the constructor with strings (with very simple/incorrect parsing)
you should rather call put for each option separately.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message