Richfaces portlet bridge 3.1.3 -- no facelet composition
jingjingfu Jan 10, 2008 3:53 PMAfter 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!