13 Replies Latest reply on Mar 16, 2009 8:01 AM by Ilya Shaikovsky

    Richfaces styles not loading

    Edem Morny Novice

      Hi,

      I recently upgraded the version of richfaces being used in our app from 3.2.1.GA to 3.2.2.GA through maven.

      Expecting everything to run perfectly,
      i was surprised when i realised that all the richfaces styling was not being loaded. I further confirmed this with firebug, that my application's own css files are the only ones being loaded.

      Is there something that has changed that I need to know of to use the 3.2.2.GA version, cos I really want to use some of the new components in this version.

        • 1. Re: Richfaces styles not loading
          Ilya Shaikovsky Master

          you sure that this is not a cache problem? And please describe your environment more carefully.

          • 2. Re: Richfaces styles not loading
            Nick Belaevski Master

            Are there any errors loading resources on Firebug "Net" tab or they are just not present there?

            • 3. Re: Richfaces styles not loading
              Edem Morny Novice

              My enviroment is as ff


              spring webflow 2.0.2
              tomcat 6.0.14
              jsf-impl 1.2_09


              And the css files are just not present when i use Firebug "Net" view. Any ideas will be of great help

              • 4. Re: Richfaces styles not loading
                Nick Belaevski Master

                Can you please post web.xml contents?

                • 5. Re: Richfaces styles not loading
                  Edem Morny Novice

                  Here is my web.xml content

                  <?xml version="1.0" encoding="UTF-8"?>
                  <web-app version="2.4" 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">
                  
                  
                   <context-param>
                   <param-name>contextConfigLocation</param-name>
                   <param-value>
                   /WEB-INF/config/web-application-config.xml
                   </param-value>
                   </context-param>
                   <context-param>
                   <param-name>org.ajax4jsf.SKIN</param-name>
                   <param-value>laguna</param-value>
                   </context-param>
                  
                  
                   <listener>
                   <listener-class>
                   org.springframework.web.context.ContextLoaderListener
                   </listener-class>
                   </listener>
                  
                   <!-- Serves static resource content from .jar files such as spring-faces.jar -->
                   <servlet>
                   <servlet-name>Resources Servlet</servlet-name>
                   <servlet-class>
                   org.springframework.js.resource.ResourceServlet
                   </servlet-class>
                   <load-on-startup>0</load-on-startup>
                   </servlet>
                  
                   <servlet-mapping>
                   <servlet-name>Resources Servlet</servlet-name>
                   <url-pattern>/resources/*</url-pattern>
                   </servlet-mapping>
                  
                   <!-- The front controller of this Spring Web application, responsible for handling all application requests -->
                   <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>
                   /WEB-INF/config/web-application-config.xml
                   </param-value>
                   </init-param>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                   <!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
                   <context-param>
                   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                   <param-value>.xhtml</param-value>
                   </context-param>
                  
                   <!-- Enables special Facelets debug output during development -->
                   <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>true</param-value>
                   </context-param>
                  
                   <!-- Causes Facelets to refresh templates during development -->
                   <context-param>
                   <param-name>facelets.REFRESH_PERIOD</param-name>
                   <param-value>1</param-value>
                   </context-param>
                   <filter>
                   <display-name>RichFaces Filter</display-name>
                   <filter-name>richfaces</filter-name>
                   <filter-class>org.ajax4jsf.Filter</filter-class>
                   </filter>
                  <!---->
                   <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>
                   <filter-mapping>
                   <filter-name>richfaces</filter-name>
                   <servlet-name>Faces Servlet</servlet-name>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                   <filter-mapping>
                   <filter-name>richfaces</filter-name>
                   <servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                  
                  
                   <servlet-mapping>
                   <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                   <url-pattern>/main/*</url-pattern>
                   </servlet-mapping>
                  
                   <!-- Just here so the JSF implementation can initialize, *not* used at runtime -->
                   <servlet>
                   <servlet-name>Faces Servlet</servlet-name>
                   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                  
                   <!-- Just here so the JSF implementation can initialize -->
                   <servlet-mapping>
                   <servlet-name>Faces Servlet</servlet-name>
                   <url-pattern>*.faces</url-pattern>
                   </servlet-mapping>
                   <welcome-file-list>
                   <welcome-file>index.html</welcome-file>
                   </welcome-file-list>
                  </web-app>
                  


                  • 6. Re: Richfaces styles not loading
                    Edem Morny Novice

                    Any reply on this issue please? I'm stuck.

                    • 7. Re: Richfaces styles not loading - confirmed problem with 3.
                      Louis Parisi Newbie

                      I am seeing the same problem. Unfortunately, I started with RichFaces 3.2.2.SR1 and have been trying to resolve the problem with no luck. After seeing this post I downloaded 3.2.1.GA and with no changes to my app the RichFaces blueSky skin is working. With 3.2.2.SR1 the RichFaces styles are not applied to the rendered html.

                      My environment
                      ---------------
                      Sun JSF 1.2
                      Spring Framework 2.5.5
                      Spring Webflow 2.0.3
                      Facelet 1.1.14
                      Tomcat 5.5.25

                      My web.xml:

                      <?xml version="1.0"?>
                      <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">
                      
                       <!-- The master configuration file for this Spring web application -->
                       <context-param>
                       <param-name>contextConfigLocation</param-name>
                       <param-value>
                       /WEB-INF/config/applicationTestContext.xml
                       </param-value>
                       </context-param>
                      
                       <!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
                       <context-param>
                       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                       <param-value>.xhtml</param-value>
                       </context-param>
                      
                       <!-- Enables special Facelets debug output during development -->
                       <context-param>
                       <param-name>facelets.DEVELOPMENT</param-name>
                       <param-value>true</param-value>
                       </context-param>
                      
                       <!-- Causes Facelets to refresh templates during development -->
                       <context-param>
                       <param-name>facelets.REFRESH_PERIOD</param-name>
                       <param-value>1</param-value>
                       </context-param>
                      
                       <!-- rich faces skin -->
                       <context-param>
                       <param-name>org.richfaces.SKIN</param-name>
                       <param-value>blueSky</param-value>
                       </context-param>
                      
                       <!-- dont know if these are needed. Added to try to get RichFaces skin to work -->
                       <context-param>
                       <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
                       <param-value>NONE,NEKO,TIDY</param-value>
                       </context-param>
                      
                       <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.ajax4jsf.COMPRESS_SCRIPT</param-name>
                       <param-value>false</param-value>
                       </context-param>
                      
                       <context-param>
                       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                       </context-param>
                       <!-- end don't know -->
                      
                       <filter>
                       <display-name>RichFaces Filter</display-name>
                       <filter-name>richfaces</filter-name>
                       <filter-class>org.ajax4jsf.Filter</filter-class>
                       </filter>
                      
                       <filter-mapping>
                       <filter-name>richfaces</filter-name>
                       <servlet-name>Faces Servlet</servlet-name>
                       <dispatcher>REQUEST</dispatcher>
                       <dispatcher>FORWARD</dispatcher>
                       <dispatcher>INCLUDE</dispatcher>
                       </filter-mapping>
                      
                       <filter-mapping>
                       <filter-name>richfaces</filter-name>
                       <servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
                       <dispatcher>REQUEST</dispatcher>
                       <dispatcher>FORWARD</dispatcher>
                       <dispatcher>INCLUDE</dispatcher>
                       </filter-mapping>
                      
                       <!-- Enforce UTF-8 Character Encoding -->
                       <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>
                      
                       <!-- Loads the Spring web application context -->
                       <listener>
                       <listener-class>
                       org.springframework.web.context.ContextLoaderListener</listener-class>
                       </listener>
                      
                       <!--
                       Serves static resource content from .jar files such as
                       spring-faces.jar
                       -->
                       <servlet>
                       <servlet-name>Resources Servlet</servlet-name>
                       <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
                       <load-on-startup>0</load-on-startup>
                       </servlet>
                      
                       <!--
                       Map all /resources requests to the Resource Servlet for handling
                       -->
                       <servlet-mapping>
                       <servlet-name>Resources Servlet</servlet-name>
                       <url-pattern>/resources/*</url-pattern>
                       </servlet-mapping>
                      
                       <!--
                       The front controller of this Spring Web application, responsible for
                       handling all application requests
                       -->
                       <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>
                      
                       <!-- Map all /spring requests to the Dispatcher Servlet for handling -->
                       <servlet-mapping>
                       <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                       <url-pattern>/spring/*</url-pattern>
                       </servlet-mapping>
                      
                       <!--
                       Just here so the JSF implementation can initialize, *not* used at
                       runtime
                       -->
                       <servlet>
                       <servlet-name>Faces Servlet</servlet-name>
                       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                       <load-on-startup>1</load-on-startup>
                       </servlet>
                      
                       <!-- Just here so the JSF implementation can initialize -->
                       <servlet-mapping>
                       <servlet-name>Faces Servlet</servlet-name>
                       <url-pattern>*.faces</url-pattern>
                       </servlet-mapping>
                      
                       <context-param>
                       <param-name>com.sun.faces.expressionFactory</param-name>
                       <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
                       </context-param>
                      
                       <welcome-file-list>
                       <welcome-file>index.html</welcome-file>
                       </welcome-file-list>
                      
                      </web-app>
                      


                      • 8. Re: Richfaces styles not loading
                        Fab Mars Novice

                        I had the same issue but it was due to my own code. Maybe you have the same. Let me explain:

                        I setup a custom phaselistener to enfore some security rules. All the RichFaces scripts urls ending in .jsf, they also passed through my phase listener. SO I added some "pass through" rule based on the path /a4j_*

                        Recently I upgraded RF to its latest version and no more script would load. I noticed the uderscore had disappeared on the a4j scrips path. Now all scrips paths are like /a4j/*

                        SO either you have a cache problem OR you have some simular machanism as I have which filters the scripts out.

                        • 9. Re: Richfaces styles not loading
                          Ilya Shaikovsky Master

                          guys.. Please fill the jira issue with war samples If you still can't resolve this because unfortunatelly this still can't be reproduced locally.

                          fabmars, thanks for the point. could be usefull for the other guys.

                          • 10. Re: Richfaces styles not loading
                            Louis Parisi Newbie

                            I created a jira case for this issue and included a war file. Thanks for your support.
                            https://jira.jboss.org/jira/browse/RF-5173

                            • 11. Re: Richfaces styles not loading
                              Ilya Shaikovsky Master

                              and thanks you to for your efforts! ;)

                              • 12. Re: Richfaces styles not loading
                                Louis Parisi Newbie

                                The problem was I had the richfaces filter mapped incorrectly:

                                The servlet name in the richfaces filter mapping was incorrect. Note filter Mapping has Spring Web MVC and servlet name is Spring MVC:

                                <filter-mapping>
                                 <filter-name>richfaces</filter-name>
                                 <servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
                                
                                


                                <servlet>
                                 <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                                 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>


                                After fixing this it worked. This incorrect mapping worked up to version 3.2.2 of richfaces. I previously had the richfaces filter mapped to both Spring MVC and Faces Servlet. I guess the mapping I had for the Faces Servlet was working in the older versions of richfaces and then in the 3.2.2 version it stopped so there was not working filter anymore. I have removed the richfaces filter mapping to the Faces Servlet and only have the corrected Spring MVC mapping now and everything is working. Sorry if this caused you any unnecessary effort.

                                • 13. Re: Richfaces styles not loading
                                  Ilya Shaikovsky Master

                                  thanks for your update.