3 Replies Latest reply on Dec 28, 2010 4:23 AM by vali_iva

    Richfaces portlet bridge 3.1.3 -- no facelet composition

    jingjingfu

      After I started the portletbridge 3.1.3 GA, my Facelets CompositionComponents aren't displayed anymore. No error, it just shows nothing in the portlet. It used to work when using the AjaxFacesPortlet class directly. I have fished through all the threads and googled , but can't find what I missed yet.

      My envirorment: Liferay 434 portal, portletbridge-api-3.1.3.GA.jar,portletbridge-impl-3.1.3.GA.jar,richfaces 3.1.3.GA, JSF Sun RI 12, facelet 1.1.12

      One note--I also tried portletbridge 3.2 snapshot ans richfaces 32 snapshot, but am getting the same result--portlet window comes up empty.

      Here is my faces-config.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
       <application>
       <view-handler>org.ajax4jsf.portlet.application.PortletViewHandler</view-handler>
      <state-manager>org.ajax4jsf.portlet.application.PortalStateManager</state-manager>
       </application>
       <factory>
      
       <faces-context-factory>
      
       org.ajax4jsf.portlet.context.FacesContextFactoryImpl
      
       </faces-context-factory>
      
       </factory>
      </faces-config>


      Here is the portlet.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
       <portlet>
       <portlet-name>richfacesPortlet</portlet-name>
       <display-name>Sample Richfaces Portlet</display-name>
      
       <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
       <init-param>
      
       <name>javax.portlet.faces.defaultViewId.view</name>
      
       <value>/test.xhtml</value>
      
       </init-param>
       <!-- disable portlet caching -->
       <expiration-cache>-1</expiration-cache>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>view</portlet-mode>
      
       </supports>
       <portlet-info>
       <title>Sample Richfaces Portlet by Michael Karas</title>
       <short-title>Sample Richfaces Portlet</short-title>
       <keywords>Sample Richfaces Portlet</keywords>
       </portlet-info>
       <security-role-ref>
       <role-name>administrator</role-name>
       </security-role-ref>
       <security-role-ref>
       <role-name>guest</role-name>
       </security-role-ref>
       <security-role-ref>
       <role-name>power-user</role-name>
       </security-role-ref>
       <security-role-ref>
       <role-name>user</role-name>
       </security-role-ref>
       </portlet>
      </portlet-app>

      here is my web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
       <display-name>Richfaces Portlet</display-name>
       <description>Richfaces Portlet</description>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
      
       <!-- Facelet configuration -->
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.SKIP_COMMENTS</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <!-- needed for portlet environment -->
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>org.ajax4jsf.portlet.application.FaceletPortletViewHandler</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
       <param-value>false</param-value>
       </context-param>
      
       <!-- Use Documents Saved as *.xhtml -->
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
      
      
       <!-- RichFaces and ajax4jsf settings -->
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.faces</url-pattern>
       </servlet-mapping>
       <session-config>
       <session-timeout>
       30
       </session-timeout>
       </session-config>
       <welcome-file-list>
       <welcome-file>test.xhtml</welcome-file>
       </welcome-file-list>
      </web-app>


      My porlet is simple --only one single rich tag in one single xhtml page:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <a4j:portlet xmlns:f="http://java.sun.com/jsf/core"
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
      
      <f:view>
       <rich:simpleTogglePanel switchType="ajax">
       <f:facet name="header">
       <h:outputText value="Ajax Switched toogle panel"/>
       </f:facet>
       <h:outputText value="hello world - from the ajaxified richfaces portlet ;)" />
       </rich:simpleTogglePanel>
      </f:view>
      </a4j:portlet>


      I used to use AjaxFacesPortlet directly, and put "org.ajax4jsf.portlet.PortletAjaxContext" in the "faces-config.xml". It kind of worked, but it has issues with JSF managed bean session scope whenver I use Ajax. Does this sounds familiar?

      What have I missed?
      Thanks a million!

        • 1. Re: Richfaces portlet bridge 3.1.3 -- no facelet composition
          ebephil

          So, if I understand you correctly, it's not just the composition components that don't show up (which you don't seem to use in that example anyway), but the whole portlet is just empty, no toggle panel?

          Does the RichFacesPortlet that Wesley Hales uploaded to the PortletSwap svn repository work for you?
          (http://anonsvn.jboss.org/repos/portletswap/portlets/src/framework/RichFacesPortlet)

          Because if that portlet doesn't show anything at all either, it might be a Liferay related problem (although thats just an unqualified guess, never really used liferay).

          I assume you double checked that the test.xhtml you are referring to in your portlet.xml really exists (in that path/war). Usually, when my portlets are showing nothing at all, I just got the navigation rule wrong or forgot to add the .xhtml to the war. But then again, I'm using JBoss Portal.

          • 2. Re: Richfaces portlet bridge 3.1.3 -- no facelet composition
            jingjingfu

            Thanks for your response! The example Wesley Hales uploaded has many JBoss portal specific settings, and I have not had luck to get it to work. So I tam trying to get one tiny portlet working. Yeah, nothing showed up. I tried a couple of tags in "test.xhtml", like <ui:comosition> , <a4j:portlet> ect. Will keep digging... Thanks again!

            • 3. Re: Richfaces portlet bridge 3.1.3 -- no facelet composition
              vali_iva

              I use Gatein and I have a similar problem. When I use Facelets the view just won't render, no errors. I tried with plain jsp and I had other problems: the rich components (richfaces) where rendered but couldn't interact to it; but the plain jsf components where working. I'm stuck with this for days, I tried all configurations from documentation, tutorials and screencasts and I can't get to the bottom of it. Any help would be great. Thanks.

               

              Vali