0 Replies Latest reply on Sep 9, 2008 9:12 AM by Emmanuel Pierre

    Richfaces + JBoss Portal => Blank page

    Emmanuel Pierre Newbie

      Hi,

      I have a portlet working fine on Pluto 1.1.15 with Tomcat 6.0.18.
      It displays a list of addresses in a table. I can add an adress by clicking a button and filling a new form.
      I use Richfaces to be able to sort this list and it works fine.

      Now, I want to use this portlet into JBoss Portal and I have a little problem when I sort my table.
      In fact I click on the header of a column and I have a Blank Page :( The browser still loading but nothing happens...
      If I make a back, the list displays AND it is sorted !!!

      Specifications of my environment :
      - JBoss AS 4.2.2 GA
      - JBoss Portal 2.6.5
      - Firefox 3.0.1 => Blank page
      - IE 7 => Nothing happens

      - jsf-api : 1.2_04-p02 (included in JBoss AS)
      - jsf-impl : 1.2_04-p02 (included in JBoss AS)
      - richfaces : 3.2.1.GA
      - spring : 2.5.5 (used to manage the Service layer)

      I use this jsf portlet bridge : https://jsfportletbridge.dev.java.net/, it works fine with Pluto.

      Here are my configuration files :
      web.xml

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
       version="2.4">
      
       <display-name>mp-spring-protlet-jsf-3</display-name>
      
       <!-- Filtres RichFaces -->
       <context-param>
       <param-name>org.richfaces.LoadStyleStrategy</param-name>
       <param-value>ALL</param-value>
       </context-param>
       <context-param>
       <param-name>org.richfaces.LoadScriptStrategy</param-name>
       <param-value>ALL</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.richfaces.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>FORWARD</dispatcher>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      
       <context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>
       /WEB-INF/classes/applicationContext.xml
       </param-value>
       </context-param>
      
       <context-param>
       <param-name>javax.faces.CONFIG_FILES</param-name>
       <param-value>/WEB-INF/classes/faces-config.xml</param-value>
       </context-param>
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
      
       <listener>
       <listener-class>
       org.springframework.web.context.ContextLoaderListener
       </listener-class>
       </listener>
      
       <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>
      
       <!-- Welcome files -->
       <welcome-file-list>
       <welcome-file>index.html</welcome-file>
       </welcome-file-list>
       <security-constraint>
       <display-name>
       Prevent access to raw JSP pages that are for JSF pages.
       </display-name>
       <web-resource-collection>
       <web-resource-name>Raw-JSF-JSP-Pages</web-resource-name>
       <url-pattern>*.jsp</url-pattern>
       </web-resource-collection>
       <auth-constraint>
       <description>No roles, so no direct access</description>
       </auth-constraint>
       </security-constraint>
      </web-app>
      


      portlet.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app
       xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
       version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
      
       <portlet>
       <description>Exemple portlet spring jsf sun</description>
       <portlet-name>SpringJsfPortlet</portlet-name>
       <portlet-class>
       com.sun.faces.portlet.FacesPortlet
       </portlet-class>
      
       <init-param>
       <name>com.sun.faces.portlet.INIT_VIEW</name>
       <value>/home.jsp</value>
       </init-param>
      
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>edit</portlet-mode>
       <portlet-mode>view</portlet-mode>
       <portlet-mode>help</portlet-mode>
       </supports>
      
       <supported-locale>fr</supported-locale>
       <portlet-info>
       <title>SpringJsfPortlet 1.2</title>
       </portlet-info>
       </portlet>
      </portlet-app>
      


      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"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
       version="1.2">
      
       <application>
       <variable-resolver>
       org.springframework.web.jsf.DelegatingVariableResolver
       </variable-resolver>
       </application>
      
       <!-- NAVIGATION -->
       <navigation-rule>
       <from-view-id>/add-entry.jsp</from-view-id>
       <navigation-case>
       <from-outcome>home</from-outcome>
       <to-view-id>/home.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <navigation-rule>
       <from-view-id>/home.jsp</from-view-id>
       <navigation-case>
       <from-outcome>add</from-outcome>
       <to-view-id>/add-entry.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <!-- FORM BEANS -->
       <managed-bean>
       <managed-bean-name>addEntryBean</managed-bean-name>
       <managed-bean-class>
       org.esupportail.JSFTut.web.AddEntryBean
       </managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
       <managed-property>
       <property-name>facadeService</property-name>
       <property-class>org.esupportail.JSFTut.web.FacadeService</property-class>
       <value>#{facadeService}</value>
       </managed-property>
       </managed-bean>
      ...
      


      And the first jsp home.jsp :
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      
      <f:loadBundle basename="messages" var="messages" />
      <f:view>
       <body>
       <h:form id="home1">
       <rich:dataTable value="#{homeBean.addresses}" var="address"
       width="300px" columnClasses="center" rows="25">
       <f:facet name="header">
       <h:outputText value="Mes adresses" />
       </f:facet>
       <rich:column sortBy="#{address.name}">
       <f:facet name="header">
       <h:outputText value="Nom" />
       </f:facet>
       <h:outputText value="#{address.name}" />
       </rich:column>
      ...
      


      Maybe I made something wrong ?
      Thanks for any idea !!!