[ 
https://issues.apache.org/jira/browse/PB-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925830#action_12925830
 ] 

Alexey Zavizionov commented on PB-109:
--------------------------------------

I have problem with two struts portlets: P1 and P2.

Let me explain the portal request sequency.
I have two portlets on a page.
I click on a link on the second portlet P2.

1. Portal execute process action on the P2
2. Portal execute render on the P1. [1]
3. Portal execute render on the P2.


In details:
1.  P2 action
1.1 PortletServletRequestDispatcher.invoke
                          req.setAttribute(StrutsPortlet.RENDER_CONTEXT, 
context);
1.2  StrutsPortlet.processRequest
                            StrutsPortletRenderContext renderContext = 
(StrutsPortletRenderContext)req.getAttribute(RENDER_CONTEXT);
                            if ( renderContext != null )
                            {
                                portletSession.setAttribute(RENDER_CONTEXT, 
renderContext);
                                // there may need to delete the attribute from 
the req
2. P1 render
2.1 StrutsPortlet.processRequest
                StrutsPortletRenderContext renderContext = 
(StrutsPortletRenderContext)portletSession.getAttribute(RENDER_CONTEXT);
                if ( renderContext != null ) {       //    <- ok, it is null
2.2 PortletServlet.performActionRenderRequest
            StrutsPortletRenderContext context = 
(StrutsPortletRenderContext)request.getAttribute(StrutsPortlet.RENDER_CONTEXT);
            if (context != null)
            {   // <--- and here we are! it is get the context from P2 stored 
before (in action phase). 
The problem is here! 
We get the same ActionForm.

3. P2 render
3.1 StrutsPortlet.processRequest
                StrutsPortletRenderContext renderContext = 
(StrutsPortletRenderContext)portletSession.getAttribute(RENDER_CONTEXT);
                if ( renderContext != null )
                {                        
                    portletSession.removeAttribute(RENDER_CONTEXT);
                    req.setAttribute(RENDER_CONTEXT, renderContext);
3.2 PortletServlet.performActionRenderRequest
            StrutsPortletRenderContext context = 
(StrutsPortletRenderContext)request.getAttribute(StrutsPortlet.RENDER_CONTEXT);
            if (context != null)
            {  

Finally, two portlets looks the similar.

FYI we didn't use attribute name encoding (per each portlet id) for names 
starts with "javax." and "org.apache".

How it could be?

[1] The render requests may be executed sequentially or in parallel without any 
guaranteed order.  (Portlet spec 286    PLT.5.4 Request Handling )


> Problem with the request wrapper (user action is not considered)
> ----------------------------------------------------------------
>
>                 Key: PB-109
>                 URL: https://issues.apache.org/jira/browse/PB-109
>             Project: Portals Bridges
>          Issue Type: Bug
>          Components: struts
>    Affects Versions: 1.0.4
>            Reporter: Ali Hamdi
>            Priority: Minor
>
> We found a bug in Struts Portals bridge reported here : 
> http://jira.exoplatform.org/browse/PC-512
> The fix done by eXo developer is here : 
> http://jira.exoplatform.org/secure/attachment/25968/diff.txt

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


---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-dev-unsubscr...@portals.apache.org
For additional commands, e-mail: bridges-dev-h...@portals.apache.org

Reply via email to