[
https://issues.apache.org/jira/browse/SLING-1219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785837#action_12785837
]
Felix Meschberger commented on SLING-1219:
------------------------------------------
Actually, implementation wise the JcrResourceResolver.map(String) method is
exactly the same as calling JcrResourceResovler.map(null, String).
With respect to the web console plugin supporting the test you have full
control of what method you call: If you provide a path -- e.g.
/content/a/page.html -- then HttpServletRequest arguement to the map method
would in fact be null. If you provide an absolute URL -- e.g.
http://localhost/contetn/a/page.html, the schema/host part of the URL would be
used to setup a HttpRequestObject with the given schema, host, and port
information.
The main difference of calling map(HttpServletRequest, String) with null or
non-null is the final decision to apply whether to leave scheme/host prefix
after mapping or to remove it (and also to select amongst multiple candidates
for the same mapping). The idea is that if a request stays on the same target,
the scheme/host prefix can be removed.
So I wonder, whether we really need this second button or whether it is merely
a question of better describing what is going on.
> Map test in JCR Resource Resolver web console plugin is not reflecting all
> cases
> --------------------------------------------------------------------------------
>
> Key: SLING-1219
> URL: https://issues.apache.org/jira/browse/SLING-1219
> Project: Sling
> Issue Type: Improvement
> Components: JCR
> Affects Versions: JCR Resource 2.0.6
> Reporter: Alexander Klimetschek
> Priority: Minor
> Attachments: SLING-1219.patch
>
>
> The "Map" test in the web console plugin of the JCR resource resolver is
> actually doing a
> ResourceResolver.map(request, path)
> with the request being something like "http://null", without even noting
> that. This is misleading as one would at least expect that the current server
> is used (ie. how the web console is accessed), eg. http://localhost in most
> cases. This difference will give different results in many cases, eg. if an
> internal redirect based on localhost.80 is configured.
> Also, there is a second map() only accepting a path which behaves different
> in that it will always add the domain prefix if configured.
> For proper testing there should be a way to do all of them.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.