[
https://issues.apache.org/jira/browse/SLING-2790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13601541#comment-13601541
]
Carsten Ziegeler commented on SLING-2790:
-----------------------------------------
Looking at the javadoc of RequestPathInfo I'm not sure if this is a bug or
correct behaviour right now. RequestPathInfo talks about decompositing of the
URL so following this docs it should always point to the original request and
not to the current resource being processed. So either the implementation is
wrong or the javadoc needs an update.
In any case I think it would make sense to have a method on the request which
returns the original/first resource which was targetted by the client
> Need a way to get the resource of the original request in a subcomponent
> ------------------------------------------------------------------------
>
> Key: SLING-2790
> URL: https://issues.apache.org/jira/browse/SLING-2790
> Project: Sling
> Issue Type: Improvement
> Components: API
> Reporter: Axel Hanikel
> Priority: Minor
>
> - I have created a component at
> /apps/training/components/tasklist/tasklist.jsp.
> - I have a page node at /content/training with a sling:resourceType of
> training/components/page
> - That page has a subnode /content/training/content/tasklist with a
> sling:resourceType of training/components/tasklist (the tasklist.jsp from
> above)
> In the tasklist.jsp, I would like to get the path to the resource of the
> original HTTP request, i.e. /content/training. I expected to get it using
> slingRequest.getRequestPathInfo().getResourcePath() but that gets me the path
> to the current resource (/content/training/content/tasklist), not the path to
> the request.
> Having the original resource in a predefined variable or a call like
> slingRequest.getOriginalRequestPathInfo() would be very helpful.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira