You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Juan Jose Vazquez Delgado (JIRA)" <ji...@apache.org> on 2009/03/24 14:31:54 UTC

[jira] Updated: (SLING-736) Ensure getPathInfo returns correct (expected) value

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

Juan Jose Vazquez Delgado updated SLING-736:
--------------------------------------------

    Remaining Estimate: 0h
     Original Estimate: 0h

The path info was overwritten when "servletRequest.getPathInfo() != null". Although, we were using the underlying  "HttpServletRequest", instead of "SlingHttpServletRequest", in RequestData.initResource, so path info was still the original one.

Patch applied in revision 757774.

Feedback about this change would be appreciate.



> Ensure getPathInfo returns correct (expected) value
> ---------------------------------------------------
>
>                 Key: SLING-736
>                 URL: https://issues.apache.org/jira/browse/SLING-736
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.2
>            Reporter: Felix Meschberger
>            Assignee: Juan Jose Vazquez Delgado
>             Fix For: Engine 2.0.4
>
>         Attachments: SLING-736.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> According to the servlet specification, a servlet registered with path "/" in its web application is considered a default servlet. For such a default servlet  the HttpServletRequest.getServletPath() and HttpServletRequest.getPathInfo() methods return different results as would be expected: getServletPath() returns the request URI path (minus the servlet context path) and getPathInfo() always returns null.
> When Sling is deployed using the PAX Web 0.5.1 this situation happens since the SlingMainServlet is registered with path "/" with the HttpService.
> To fix this situation for Sling and ensuring the expected getServletPath() (of minor use in Sling) and getPathInfo() (very important for all authentication as well as resource resolution), the Sling engine is modified as follows:
> * The SlingMainServlet is always registered with the HttpService with the servlet path "/". This cannot be configurable.
> * The SlingHttpServletRequestImpl, which is instantiated by the SlingMainServlet to provide the SlingHttpServletRequest interface, is modified to overwrite the getServletPath() and getPathInfo() methods as follows (see also Section SRV.4.4 in Servlet API 2.4 spec) :
>    * getServletPath() always returns ""
>    * getPathInfo() always returns the getServletPath()+getPathInfo()
>         called on the servlet container (or HttpService provided)
>         HttpServletRequest object
> More information on this issue is available in the Mail Thread http://markmail.org/message/34cithemwzadolw3

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.