2 Replies Latest reply on Oct 7, 2011 11:37 AM by ridcully

    Problems with Liferay, JBoss, JSF 1.2 and Portlet Bridge 2

    ridcully

      Hello,

       

      we are using Liferay 5.2.3/JBoss 5, JSF 1.2/Richfaces 3.3.3 and the Portletbridge 1.0 in our projects and everythinks works fine so far. To get better Portlet 2.0 support we updated the portletbridge to the version 2.1 and encountered two anoying problems.

       

      First of all our mix of jsp and facelets doesn't work anymore. The jsp based portlets do not produce any output.

      One other frustrating thing is, that the BridgeEventHandler produces incorrect views for the event receiving portlets.

      This is not the fault of the BridgeEventHandler, but the view id of the portlet sending the event is contained in the event request. We think it could be an Liferay issue, but we are not sure.

       

      We use the following configuration in our web.xml:

       

        <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.jsp</param-value>
        </context-param>
        <context-param>
          <param-name>facelets.VIEW_MAPPINGS</param-name>
          <param-value>*.xhtml</param-value>
        </context-param>
        <context-param>
          <param-name>javax.portlet.faces.RENDER_POLICY</param-name>
          <param-value>DEFAULT</param-value>
        </context-param>
        <context-param>
          <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
          <param-value>false</param-value>
        </context-param>
        <context-param>
          <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
          <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
        </context-param>
      

       

      Any help would be great!

      Thanks in advance! 

        • 1. Re: Problems with Liferay, JBoss, JSF 1.2 and Portlet Bridge 2
          maggus

          we also have issues with this combination...

           

          http://community.jboss.org/thread/173233

          • 2. Re: Problems with Liferay, JBoss, JSF 1.2 and Portlet Bridge 2
            ridcully

            We have investigate much deeper into the bridge and found the problem.

             

            The org.jboss.portletbridge.context.PortletExternalContextImpl.dispatch(String) method has changed the dispatcher call from include to forward and because of this we got an broken jspUrl in the JSPServlet.

             

            Now we test a custom FacesContextFactoryImpl which patch the PortletExternalContextImpls with a modified dispatch method. e.g.:

             

            externalContext = new EventRequestExternalContextImpl(

                                    (PortletContext) context, (EventRequest) request,

                                    (EventResponse) response)

                            {

                                public void dispatch(String path) throws IOException {

                                    if (null == path) {

                                       throw new NullPointerException("Path to new view is null");

                                    }

                                    PortletRequestDispatcher dispatcher = getContext()

                                          .getRequestDispatcher(path);

                                    if (null == dispatcher) {

                                       throw new IllegalStateException(

                                             "Dispatcher for render request is not created");

                                    }

                                    try {

                                       dispatcher.include(getRequest(), getResponse());

                                    } catch (PortletException e) {

                                       throw new FacesException(e);

                                    } finally {

                                    }

                                 }

                               

                            };

             

            Maybe someone has a better patch and hopefully a solution for our second issue?

            Best regards