Richfaces 4.3.1 CSS resources not being referrenced in compiled <h:head> component
specialed Apr 5, 2013 10:11 AMHi all,
I am having troubles migrating a project from RF 3.x to 4.3.1. Here's my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Project</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.resourceOptimization.enabled</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.enableControlSkinning</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>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/org.richfaces.resources/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>999</session-timeout>
</session-config>
<!-- Welcome files -->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
As you can see in the HTML output, only javascript resources are being injected, but no stylesheets (blueSky). All depenedencies are valid, since the container is JBoss AS 7 (most libaries are "built in"), I was only required to add cssparser library.
<head>
<link type="text/css" rel="stylesheet" href="/Project/javax.faces.resource/theme.css.xhtml?ln=primefaces-aristo">
<script type="text/javascript" src="/Project/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.3.1.Final/Packed/packed/packed.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Project</title>
<link rel="shortcut icon" href="../../images/symbols/favicon.ico">
</head>
And since I was able to get "helloworld-rf" (jboss quickstarts) to run almost correctly (at least stylesheet was injected there, but ajax stopped working), I doubt that the migration process should be that of a big deal. So my question is; Does Richfaces support the WAR in EAR mechanism for deployment?
My deployment hierarchy has the following pattern:
Project.ear
+-- lib
+-- project_util_module.jar
+-- META-INF
+-- application.xml
+-- jboss-deployment-structure.xml
+-- MANIFEST.MF
+-- project_moduleA.jar
+-- project_moduleB.jar
+-- project_moduleC.jar
+-- project_moduleD.jar
+-- project_modeleWEB.war
+-- css
+-- custom.css
+-- faces
+-- all XHTML files
+-- images (self explanatory)
+-- META-INF
+-- MANIFEST.MF (javax.faces.api, com.google.guava, org.w3c.css.sac, com.sun.jsf-impl)
+-- WEB-INF
+-- classes
+-- lib (cssparser.jar and all richfaces.jar)
+-- faces-config.xml
+-- web.xml
+-- index.xhtml
Legend:
- folders
- WAR package
If there are further question, just feel free to ask.