You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Philipp Koch (JIRA)" <ji...@apache.org> on 2010/03/22 11:02:27 UTC

[jira] Created: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

"org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
-------------------------------------------------------------------------------------------------------------------------------

                 Key: SLING-1456
                 URL: https://issues.apache.org/jira/browse/SLING-1456
             Project: Sling
          Issue Type: Bug
          Components: Servlets
            Reporter: Philipp Koch
            Priority: Critical


how to reproduce:
forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Commented: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848089#action_12848089 ] 

Felix Meschberger commented on SLING-1456:
------------------------------------------

The problem is that the StreamRendererServlet inspects the "org.apache.sling.api.include.servlet" request attribute which is defined to indicate the servlet including the currently running servlet or script.

In the case of a forwarded request, this attribute is not expected to be set (exactly like the respective javax.servlet.include.* attributes) since a forward is just like a direct a request to the forward target.

The problem here is, that the RequestData.pushContent method in preparation of a call to a servlet being called from the SlingRequestDispatcher ignoring whether the content is included due to RequestDispatcher.include or RequestDispatcher.forward.

The fix is to set the request attributes properly in the SlingRequestDispatcher.include method.

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Closed: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed SLING-1456.
------------------------------------


Close after release

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For: Engine 2.1.0
>
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Commented: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849625#action_12849625 ] 

Felix Meschberger commented on SLING-1456:
------------------------------------------

Added integration tests validating the presence (for RequestDispatcher.include) and absence (for RequestDispatcher.forward) of the request attributes in Rev. 927311

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For: Engine 2.1.0
>
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Assigned: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-1456:
----------------------------------------

    Assignee: Felix Meschberger

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Resolved: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-1456.
--------------------------------------

    Resolution: Fixed

Updated the "Request Processing" [1] with the list of request attributes now set for included requests.

[1] http://sling.apache.org/site/dispatching-requests.html

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For: Engine 2.1.0
>
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Commented: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849088#action_12849088 ] 

Felix Meschberger commented on SLING-1456:
------------------------------------------

Rev. 926955:

Added the Servlet API javax.servlet.include.* attribute names as constants to the SlingConstants interface in the Sling API.

Added a new constant 

    ATTR_REQUEST_PATH_INFO = "org.apache.sling.api.include.request_path_info"

to purvey the SlingHttpServletRequest.getRequestPathInfo() of the including servlet or script.

Removed handling of the ATTR_REQUEST_CONTENT and ATTR_REQUEST_SERVLET request parameters from the RequestData pushContent and popContent methods. These methods cannot decide whether a request is being included or forwarded to.

Added complete request attribute handling to the SlingRequestDispatcher.include method. This includes setting and resetting the ATTR_REQUEST_* and ATTR_INCLUDE_* request attributes. The SlingRequestDispatcher.forward method has been extended to ensure these attributes are not set.

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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


[jira] Updated: (SLING-1456) "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-1456:
-------------------------------------

          Component/s:     (was: Servlets)
                       Engine
    Affects Version/s: Engine 2.0.6
        Fix Version/s: Engine 2.1.0

This is a problem in the Sling Engine, actually

> "org.apache.sling.api.include.servlet" request attribute is set as well when RequestDispatcher#forward is called which is wrong
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1456
>                 URL: https://issues.apache.org/jira/browse/SLING-1456
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.0.6
>            Reporter: Philipp Koch
>            Assignee: Felix Meschberger
>            Priority: Critical
>             Fix For: Engine 2.1.0
>
>
> how to reproduce:
> forward a file resource and look at the http conversation. you will encounter that the "If-Modified-Since" header is never set because of a !included check in the StreamRendererServlet#doGet method. in consequence browser caching is not possible.

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