Announcement Announcement Module
Collapse
No announcement yet.
Suggested configuration for webflow+JSF+portlet in WAS Portal Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    If anybody's interested about integration Websphere Portal 6.1.

    After some investigation, if you set some request attributes during an ActionPhase, they will still be visible to the renderPhase that immediately follows it. The JSR 168 doesn't seem adamant about this point, so not sure if it's a bug or not.

    However, "cleanest" way I found for working around this is using a custom HandlerAdapter, extending webflow's one, that removes any added request attribute after actionPhase completion.

    Something like
    Code:
    public class MyHandlerAdapter extends FlowHandlerAdapter {
        public void handleAction(final ActionRequest request,
            final ActionResponse response, final Object handler) throws Exception {
            final Collection beforeActionAttributes =
                Collections.list(request.getAttributeNames());
    
            super.handleAction(request, response, handler);
            // clean up attributes contributed by the action phase
            final ArrayList afterActionAttributes =
                Collections.list(request.getAttributeNames());
    
            afterActionAttributes.removeAll(beforeActionAttributes);
            if (! afterActionAttributes.isEmpty()) {
                for (Iterator it = afterActionAttributes.iterator(); .hasNext();) {
                    final String  attribute = (String) it.next();
                    request.removeAttribute(attribute);
                }
            }
        }
    }
    Also, if you want to use facelets, webflow, AND java-net portlet-bridge, you may encounter issues with ViewHandler implementations not being chained in the good order : as portlet-bridge contributes one, and as it doesn't delegate to another one, if webflow's ViewHandler gets wired after it, no views will ever be found.
    A workaround for this is to hardwire the order in your own ViewHandler (you will have to provide one for portlet enabled facelets anyway), with a constructor as follows
    Code:
    public class MyFaceletPortletViewHandler extends FaceletViewHandler {
        /**
         * Need to hardwire the view handlers as JSF spec doesn't allow precise ordering of them 
         * and webflow one needs to be BEFORE portlet bridge's one !
         */
        public MyFaceletPortletViewHandler() {
            super(/* webflow first */ 
                new FlowViewHandler(
                /* then portlet bridge */
                new ViewHandlerImpl(
                    /* and last jsf ri one*/
                    new com.sun.faces.application.ViewHandlerImpl())));
        }
     ....
    }
    Last edited by Thibaut; Apr 22nd, 2009, 08:38 AM. Reason: improve formatting

    Comment


    • #17
      does anyone get a4j and ibm portal server work together?

      Comment

      Working...
      X