You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "DK (JIRA)" <de...@myfaces.apache.org> on 2010/05/23 17:34:24 UTC

[jira] Commented: (PORTLETBRIDGE-127) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove() does not seem to work wth the bridge

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

DK commented on PORTLETBRIDGE-127:
----------------------------------

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.