You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2011/01/18 22:12:00 UTC

[jira] Created: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

ServletContextImpl does not propagate context attribute changes to parent context
---------------------------------------------------------------------------------

                 Key: FELIX-2788
                 URL: https://issues.apache.org/jira/browse/FELIX-2788
             Project: Felix
          Issue Type: Bug
          Components: HTTP Service
    Affects Versions: http-2.0.4
            Reporter: Tobias Bocanegra
             Fix For: http-2.0.6


org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.

so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.


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


[jira] Commented: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

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

Felix Meschberger commented on FELIX-2788:
------------------------------------------

More details on the use case: We have a legacy application which stores some application state in a servlet context attribute. When an Http Session is destroyed the state must be updated in the servlet context attribute.

The problem is, that the Http Session provides the ServletContext from the servlet container and the servlet refers to the servlet context from the Http Service implementation. The Http Service implementation creates a ServletContext object for each HttpContext used to register servlets and resources and each ServletContext maintains its own map of context attributes. As a consequence the servlet container's servlet context does not know of the servlet context used by the servlet(s) and thus the attributes are not visible.

To solve this problem in this application, I will extend servlet context attribute handling to optionally share request attributes. If a configuration property is set, servlet context attributes are maintained in the servlet container's servlet context only. Otherwise (and by default) servlet context attributes are maintained in each Servlet Context separately.

Note: Wrapping of the HttpSession object is the subject of another issue: FELIX-2797

> ServletContextImpl does not propagate context attribute changes to parent context
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-2788
>                 URL: https://issues.apache.org/jira/browse/FELIX-2788
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.0.4
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: http-2.0.6
>
>
> org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
> this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.
> so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.

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


[jira] Commented: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

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

Felix Meschberger commented on FELIX-2788:
------------------------------------------

Also updated the Http Service documentation page (added section "Servlet Context Notes")

> ServletContextImpl does not propagate context attribute changes to parent context
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-2788
>                 URL: https://issues.apache.org/jira/browse/FELIX-2788
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.0.4
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: http-2.0.6
>
>
> org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
> this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.
> so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.

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


[jira] Assigned: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

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

Felix Meschberger reassigned FELIX-2788:
----------------------------------------

    Assignee: Felix Meschberger

> ServletContextImpl does not propagate context attribute changes to parent context
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-2788
>                 URL: https://issues.apache.org/jira/browse/FELIX-2788
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.0.4
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: http-2.0.6
>
>
> org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
> this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.
> so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.

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


[jira] Resolved: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

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

Felix Meschberger resolved FELIX-2788.
--------------------------------------

    Resolution: Fixed

Allow for the configuration of shared ServletContext attributes. Currently configuration is static using a framework property -- org.apache.felix.http.shared_servlet_context_attributes -- which when set to true causes servlet context attributes to be shared amongst all servlet contexts as well as the servlet container's servlet context.

Implemented in Rev. 1062830

> ServletContextImpl does not propagate context attribute changes to parent context
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-2788
>                 URL: https://issues.apache.org/jira/browse/FELIX-2788
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.0.4
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: http-2.0.6
>
>
> org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
> this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.
> so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.

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


[jira] Closed: (FELIX-2788) ServletContextImpl does not propagate context attribute changes to parent context

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

Felix Meschberger closed FELIX-2788.
------------------------------------


Close issues after release

> ServletContextImpl does not propagate context attribute changes to parent context
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-2788
>                 URL: https://issues.apache.org/jira/browse/FELIX-2788
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http-2.0.4
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>             Fix For: http-2.2.0
>
>
> org.apache.felix.http.base.internal.context.ServletContextImpl does not propagate context attribute changes to parent context.
> this is a problem for example when a session event is triggered. then the evt.getSession().getServletContext() is the one of the servlet container and not the felix one, thus the context attributes added prior to the servlet context are not visible.
> so either wrap the httpsession in the events with a java proxy for a complete isolation, or delegate all attribute modifications to the parent context.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira