Richfaces 4 & Pretty Faces 3.3.0 Runs On Glassfish 3.1

Splash Forums PrettyFaces Users Richfaces 4 & Pretty Faces 3.3.0 Runs On Glassfish 3.1

This topic contains 2 replies, has 2 voices, and was last updated by  Christian Kaltepoth 5 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18004

    Justinus
    Participant

    bang~~

    Hey guys,

    Here is the story. I was previously using primefaces and pretty faces to build my web module.They coexisted well with each other around Glassfish 3.1.

    This Monday I started building another application using Richfaces 4 and Pretty faces. I simply copied the maven dependency declaration and wrote pretty-faces.xml as usually did. Problem came to me when the application was deployed to Glassfish 3.1. CSS stylesheet

    could not be loaded correctly. css link such as “/xXx/rfRes/skinning.ecss.jsf?db=eAHL6rC8BQAEkAIG”,which actually fires jsf request to retrieve css files failed to work. What I can get through requesting such url is a “HTTP Status 500” page reporting a NullPointerException.

    I sought around the forum for solution and got some tip in “http://ocpsoft.com/support/topic/npe-in-glassfish-31”. Then I got my glassfish server updated to 3.1.1. And my problem disappeared after that.Now I think that’s the problem of Mojarra bugs.

    The story ends~~

    Now I got a question. Since either Primefaces or Richfaces retrieves resources through a jsf request. why did Pf work fine while Rf4 fail to work properly. I’m wondering what was the problem inside. Can anyone explain, please?

    :)

    #21219

    Justinus
    Participant

    Libraries

    • Richfaces 4.0.0.Final
    • Prettyfaces 3.3.0
    • Glassfish3.1,JSF2.1

    relevant files

    pretty-config.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.0 http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd">

    <url-mapping id="index">

    <pattern value="/" />

    <view-id value="/html/index.jsf" />

    </url-mapping>

    <url-mapping>

    <pattern value="/style/2c-hd-lc-static-layout" />

    <view-id value="/stylesheet/2c-hd-lc-static-layout.css" />

    </url-mapping>

    <url-mapping>

    <pattern value="/style/2c-hd-lc-static-presentation" />

    <view-id value="/stylesheet/2c-hd-lc-static-presentation.css" />

    </url-mapping>

    </pretty-config>

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"

    xmlns:xml="http://www.w3.org/XML/1998/namespace" 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_3_0.xsd ">

    <display-name>Archetype Created Web Application</display-name>

    <context-param>

    <param-name>facelets.DEVELOPMENT</param-name>

    <param-value>true</param-value>

    </context-param>

    <context-param>

    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

    <param-value>.xhtml</param-value>

    </context-param>

    <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>*.jsf</url-pattern>

    </servlet-mapping>

    </web-app>

    Template.xhtml

    <html xmlns="http://www.w3.org/1999/xhtml"

    xmlns:ui="http://java.sun.com/jsf/facelets"

    xmlns:h="http://java.sun.com/jsf/html"

    xmlns:f="http://java.sun.com/jsf/core"

    xmlns:a4j="http://richfaces.org/a4j"

    xmlns:rich="http://richfaces.org/rich">

    <h:head>

    <title><ui:insert name="title">Default title</ui:insert></title>

    <link rel="stylesheet" type="text/css"

    href="#{request.contextPath}/style/2c-hd-lc-static-layout" />

    <link rel="stylesheet" type="text/css"

    href="#{request.contextPath}/style/2c-hd-lc-static-presentation" />

    </h:head>

    <h:body>

    <div id="header">

    <ui:insert name="header">

    <ui:include src="header.xhtml" />

    </ui:insert>

    </div>

    <div id="leftColumn">

    <ui:insert name="navigator">

    <ui:include src="navigator.xhtml" />

    </ui:insert>

    </div>

    <div id="content">

    <div id="contentBody">

    <ui:insert name="content">

    </ui:insert>

    </div>

    </div>

    </h:body>

    </html>

    index.xhtml

    <ui:composition xmlns="http://www.w3.org/1999/xhtml"

    xmlns:ui="http://java.sun.com/jsf/facelets"

    xmlns:h="http://java.sun.com/jsf/html"

    xmlns:f="http://java.sun.com/jsf/core"

    xmlns:a4j="http://richfaces.org/a4j"

    xmlns:rich="http://richfaces.org/rich" template="template.xhtml">

    <ui:define name="title">

    <h:outputText value="#{indexController.title}" />

    </ui:define>

    <ui:define name="content">

    <rich:panel>

    <h:outputText value="xXx" />

    </rich:panel>

    </ui:define>

    </ui:composition>

    Expected Behavior

    all css should be loaded correctly

    Actual Behavior

    custom css (#{request.contextPath}/style/2c-hd-lc-static-layout) are loaded correctly.

    while the css of richfaces could not be loaded.

    #21220

    That’s a very interesting question. My guess would have been that this problem also occurs when using PrimeFaces on GlassFish 3.1. I really don’t know why this not happening with PrimeFaces.

    Perhaps it has something to do with the fact that the RichFaces resource is processed by the FacesServlet because of the *.jsf extension (/xXx/rfRes/skinning.ecss.jsf?)?

    Perhaps you will find an answer in the upstream issue:

    http://java.net/jira/browse/GLASSFISH-15985

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.