[ 
https://issues.apache.org/jira/browse/PORTLETBRIDGE-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870416#action_12870416
 ] 

DK edited comment on PORTLETBRIDGE-127 at 5/23/10 11:35 AM:
------------------------------------------------------------

I've upgraded project to use Spring Web 3.0.2:

<dependency org="org.springframework" name="spring-web" rev="3.0.2.RELEASE" 
conf="compile,runtime->default"/>

The problem still exists. I've done a debugging session with 3.0.2 Spring 
sources. What I could tell is that ServletRequestAttributes.setAttribute() was 
hit from the code below:

org.springframework.web.context.request.AbstractRequestAttributesScope
{code}
        public Object get(String name, ObjectFactory objectFactory) {
                RequestAttributes attributes = 
RequestContextHolder.currentRequestAttributes();
                Object scopedObject = attributes.getAttribute(name, getScope());
                if (scopedObject == null) {
                        scopedObject = objectFactory.getObject();
                        attributes.setAttribute(name, scopedObject, 
getScope()); //calling here
                }
                return scopedObject;
        }
{code}
I've attached the full stack trace from a debugger. My debugging session was a 
bit funky - not all of the breakpoints were showing up as active, etc., but at 
least this one was hit for the "app" bean.

I browsed around in Spring code. It looked to me that Portlet attributes might 
come into play only for SCOPE_GLOBAL_SESSION, but the logic was a bit too 
convoluted for me to grok it.

See org.springframework.web.context.request.FacesRequestAttributes:

        public Object getAttribute(String name, int scope) {
                if (scope == SCOPE_GLOBAL_SESSION && portletApiPresent) {
                        return PortletSessionAccessor.getAttribute(name, 
getExternalContext());
                }
                else {
                        return getAttributeMap(scope).get(name);
                }
        }

      was (Author: dkroot):
    I've upgraded project to use Spring Web 3.0.2:

<dependency org="org.springframework" name="spring-web" rev="3.0.2.RELEASE" 
conf="compile,runtime->default"/>

The problem still exists. I've done a debugging session with 3.0.2 Spring 
sources. What I could tell is that ServletRequestAttributes.setAttribute() was 
hit from the code below:

org.springframework.web.context.request.AbstractRequestAttributesScope

        public Object get(String name, ObjectFactory objectFactory) {
                RequestAttributes attributes = 
RequestContextHolder.currentRequestAttributes();
                Object scopedObject = attributes.getAttribute(name, getScope());
                if (scopedObject == null) {
                        scopedObject = objectFactory.getObject();
                        attributes.setAttribute(name, scopedObject, 
getScope()); //calling here
                }
                return scopedObject;
        }

I've attached the full stack trace from a debugger. My debugging session was a 
bit funky - not all of the breakpoints were showing up as active, etc., but at 
least this one was hit for the "app" bean.

I browsed around in Spring code. It looked to me that Portlet attributes might 
come into play only for SCOPE_GLOBAL_SESSION, but the logic was a bit too 
convoluted for me to grok it.

See org.springframework.web.context.request.FacesRequestAttributes:

        public Object getAttribute(String name, int scope) {
                if (scope == SCOPE_GLOBAL_SESSION && portletApiPresent) {
                        return PortletSessionAccessor.getAttribute(name, 
getExternalContext());
                }
                else {
                        return getAttributeMap(scope).get(name);
                }
        }
  
>  
> FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove()
>  does not seem to work wth the bridge
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-127
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-127
>             Project: MyFaces Portlet Bridge
>          Issue Type: Bug
>    Affects Versions: 1.0.0-beta
>         Environment: WebSphere Portal 6.1.5 running on Windows XP Pro
> MyFaces Portal Bridge 1.0.0.beta2
>            Reporter: DK
>         Attachments: setAttribute() stack.txt, Thread Dumps.log
>
>
> I've been working on a POC application with PrimeFaces, deploying as a web 
> app first, and then portalizing it and deploying to WebSphere Portal.
> When deployed as a web app, the following method removing JSF managed bean 
> worked fine:
>     public static void discardManagedObject(String objName) {
>         
> FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(objName);
>     }
> It also seemed to work on the previous iteration of this app with IBM JWL 
> Portlet Bridge 3.1.3.
> When deployed as a portlet with MyFaces Bridge 1.0.0.beta2, this does not 
> seem to work anymore and the logic in code had to be changed as a workaround.

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

Reply via email to