Reputation: 320
I'm using RichFaces 4 along with JSF, Spring, and Spring Web Flow on JBoss EAP 6.1, migrating from corresponding technologies on JBoss EAP 5.1 (e.g., RichFaces 3.3).
The problem is that any component or control in the rich: namespace will have some HTML generated for it, but when it is rendered in the browser, it looks nothing like the corresponding component on the RichFaces showcase site. It seems as though there are CSS and maybe image files that should be bundled with the RichFaces jar files, but the browser is not able to find them. Screen shot below. .
As a test, I chose a simple control, the rich:collapsiblePanel and pasted the sample code from the showcase website into a test page in our application. The collapsible panel appears, but looks nothing like the one on the demo site. Screen shot below. .
I'm getting the same result across multiple browsers (IE, Firefox, and Chrome) and across multiple rich: components (rich:extendedDataTable, rich:tabPanel, rich:calendar for example) so I think this points to a library or configuration issue.
Below is a list of libraries I'm using.
aopalliance-1.0.jar
aspectjweaver.jar
cglib-nodep-2.2.2.jar
commons-beanutils-1.8.3.jar
commons-codec-1.5.jar
commons-collections-3.2.1.jar
commons-digester-2.1.jar
commons-lang-2.6.jar
commons-logging-1.1.jar
cssparser-0.9.5.jar
guava-r09.jar
jdom.jar
log4j-1.2.16.jar
org.springframework.binding-2.3.2.RELEASE.jar
org.springframework.faces-2.3.2.RELEASE.jar
org.springframework.js-2.3.2.RELEASE.jar
org.springframework.js.resources-2.3.2.RELEASE.jar
org.springframework.webflow-2.3.2.RELEASE.jar
poi-3.8-20120326.jar
richfaces-components-api-4.3.2.Final-redhat-1.jar
richfaces-components-ui-4.3.2.Final-redhat-1.jar
richfaces-core-api-4.3.2.Final-redhat-1.jar
richfaces-core-impl-4.3.2.Final-redhat-1.jar
sac-1.3.jar
spring-aop-3.2.0.RELEASE.jar
spring-aspects-3.2.0.RELEASE.jar
spring-beans-3.2.0.RELEASE.jar
spring-context-3.2.0.RELEASE.jar
spring-context-support-3.2.0.RELEASE.jar
spring-core-3.2.0.RELEASE.jar
spring-expression-3.2.0.RELEASE.jar
spring-instrument-3.2.0.RELEASE.jar
spring-instrument-tomcat-3.2.0.RELEASE.jar
spring-jdbc-3.2.0.RELEASE.jar
spring-jms-3.2.0.RELEASE.jar
spring-orm-3.2.0.RELEASE.jar
spring-oxm-3.2.0.RELEASE.jar
spring-security-acl-3.1.3.RELEASE.jar
spring-security-aspects-3.1.3.RELEASE.jar
spring-security-cas-3.1.3.RELEASE.jar
spring-security-config-3.1.3.RELEASE.jar
spring-security-core-3.1.3.RELEASE.jar
spring-security-crypto-3.1.3.RELEASE.jar
spring-security-ldap-3.1.3.RELEASE.jar
spring-security-openid-3.1.3.RELEASE.jar
spring-security-remoting-3.1.3.RELEASE.jar
spring-security-taglibs-3.1.3.RELEASE.jar
spring-security-web-3.1.3.RELEASE.jar
spring-struts-3.2.0.RELEASE.jar
spring-test-3.2.0.RELEASE.jar
spring-tx-3.2.0.RELEASE.jar
spring-web-3.2.0.RELEASE.jar
spring-webmvc-3.2.0.RELEASE.jar
spring-webmvc-portlet-3.2.0.RELEASE.jar
And here's my web.xml, with only a few parts changed for anonymity (app-servlet.xml and com.app.class).
<?xml version="1.0" encoding="ASCII"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/app-servlet.xml
</param-value>
</context-param>
<filter>
<filter-name>charEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>charEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>DEFAULT</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
<param-value>1</param-value>
</context-param>
<filter>
<filter-name>RewriteRequestHeaderFilter</filter-name>
<filter-class>com.app.class</filter-class>
</filter>
<filter-mapping>
<filter-name>RewriteRequestHeaderFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-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>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
I've also looked at this question and this question which seem to be related, but I couldn't find any information to help solve my problem.
Any suggestions?
Upvotes: 2
Views: 1176
Reputation: 320
Turns out it was a Spring configuration issue. If you're using Spring and/or Spring Web Flow, check for the following code in your config files. Note that these are just code snippets, not complete config files.
webflow-config.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
http://www.springframework.org/schema/faces
http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">
webmvc-config.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">
<faces:resources />
<!-- Needed for RichFaces! -->
<bean name="richfacesResourceHandler" class="org.springframework.faces.webflow.JsfResourceRequestHandler" />
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="order" value="0" />
<property name="mappings">
<value>
/rfRes/**=richfacesResourceHandler
</value>
</property>
</bean>
Upvotes: 2