9 Replies Latest reply on Jan 26, 2009 5:54 AM by ilya_shaikovsky

    Stylesheet and javascript loading error

    cordnerg

      Hi,
      I have upgraded to richfaces 3.3.0 GA (from 3.2.0). Now when launch my application none of the richfaces stylesheets or javascript files load on the first rendering of the app. If I navigate to the homepage again the page reloads with the css/js included correctly.

      Has anyone seen this issue in upgrading to 3.3.0 or know of a solution?

      Thanks,
      Graham

        • 1. Re: Stylesheet and javascript loading error
          nbelaevski

          Hello Graham,

          Looks not like a known issue. Can you please describe the environment: JSF version, application server title and version, Seam version (if any)?

          • 2. Re: Stylesheet and javascript loading error
            cordnerg

            Jboss 4.2.2.GA and I believe the version of JSF is Glassfish JSF 1.2. We are not running seam.

            • 3. Re: Stylesheet and javascript loading error
              cordnerg

              Hi,
              I managed to resolve this issue. It appeared that the app was not going through the richfaces servlet from my acegi logon screen which went from a jsp page to the richfaces page via a jsp redirect.

              <jsp:forward page="/requestForServiceList.faces"/>


              I change the jsp redirect to using a meta tag.

              <meta HTTP-EQUIV="REFRESH" content="0; url=requestForServiceList.faces">


              Although I don't think this has fixed the route cause of the issue it has resolved the problem. Nor does it explain why the the redirect worked in version 3.2.0 and not 3.2.2

              Regards,
              Graham

              • 4. Re: Stylesheet and javascript loading error
                nbelaevski

                Graham,

                Can you please post web.xml? We'll investigate what's going on.

                • 5. Re: Stylesheet and javascript loading error
                  adubovsky

                  I have verified behaviour of the application with jsp:forward running on GlassFish Server v2 Update Release 2 and seems like all works fine.

                  So, as nbelaevski said, post your web.xml please.

                  • 6. Re: Stylesheet and javascript loading error
                    cordnerg

                    Here's the web.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
                    <web-app id="LPEW">
                     <display-name>Loss Prevention Engineering Workstation</display-name>
                     <description>
                     The Loss Prevention Engineering Workstation application
                     </description>
                     <!-- distributable/-->
                     <!-- Session Timeout: minutes -->
                     <session-config>
                     <session-timeout>60</session-timeout>
                     </session-config>
                    
                     <!-- This allows us to split up the spring application context into logical files -->
                     <context-param>
                     <param-name>contextConfigLocation</param-name>
                     <param-value>
                     classpath:resources//lpew-security.xml
                     classpath:resources//lpew-services.xml
                     classpath:resources//lpew-data.xml
                     </param-value>
                     </context-param>
                    
                     <!-- Log4j properties file location -->
                     <context-param>
                     <param-name>log4jConfigLocation</param-name>
                     <param-value>classpath:resources//log4j.properties</param-value>
                     </context-param>
                    
                     <!-- Default suffic is jspx for facelets useage -->
                     <context-param>
                     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                     <param-value>.jspx</param-value>
                     </context-param>
                    
                     <!-- Force jspx files through facelets servlet -->
                     <context-param>
                     <param-name>facelets.VIEW_MAPPINGS</param-name>
                     <param-value>*.jspx</param-value>
                     </context-param>
                    
                     <!-- Faclets needs it's own taglib def for custom components (fileUpload). -->
                     <!-- i.e. standard JSP taglib definition won't do -->
                     <context-param>
                     <param-name>facelets.LIBRARIES</param-name>
                     <param-value>/WEB-INF/corejsf.taglib.xml</param-value>
                     </context-param>
                    
                     <!-- Default application style on richfaces components -->
                     <context-param>
                     <param-name>org.richfaces.SKIN</param-name>
                     <param-value>blueSky</param-value>
                     </context-param>
                    
                     <!-- This allows us to split up the faces-config into logical files -->
                     <context-param>
                     <param-name>javax.faces.CONFIG_FILES</param-name>
                     <param-value>
                     /WEB-INF/faces-config-beans.xml,
                     /WEB-INF/faces-config-navigation.xml
                     </param-value>
                     </context-param>
                    
                     <!-- Filter all request through Acegi/Spring Security. -->
                     <filter>
                     <filter-name>Acegi Filter Chain Proxy</filter-name>
                     <filter-class>
                     org.acegisecurity.util.FilterToBeanProxy
                     </filter-class>
                     <init-param>
                     <param-name>targetClass</param-name>
                     <param-value>
                     org.acegisecurity.util.FilterChainProxy
                     </param-value>
                     </init-param>
                     </filter>
                     <filter-mapping>
                     <filter-name>Acegi Filter Chain Proxy</filter-name>
                     <url-pattern>/*</url-pattern>
                     <dispatcher>FORWARD</dispatcher>
                     <dispatcher>REQUEST</dispatcher>
                     </filter-mapping>
                    
                    
                    
                     <filter>
                     <filter-name>JpaFilter</filter-name>
                     <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
                     </filter>
                     <filter-mapping>
                     <filter-name>JpaFilter</filter-name>
                     <url-pattern>/*</url-pattern>
                     </filter-mapping>
                    
                     <!-- Richfaces implmented via JEE serlet. Default setting for richfaces. -->
                     <filter>
                     <filter-name>richfaces</filter-name>
                     <display-name>richfaces</display-name>
                     <description></description>
                     <filter-class>org.ajax4jsf.Filter</filter-class>
                     </filter>
                    
                     <filter-mapping>
                     <filter-name>richfaces</filter-name>
                     <servlet-name>Faces Servlet</servlet-name>
                     </filter-mapping>
                    
                     <!-- Custom JSF upload componet implmneted as servlet filter -->
                     <filter>
                     <filter-name>Upload Filter</filter-name>
                     <filter-class>com.corejsf.UploadFilter</filter-class>
                     <init-param>
                     <param-name>sizeThreshold</param-name>
                     <param-value>1024</param-value>
                     </init-param>
                     </filter>
                    
                     <!-- Filter all request through file upload. TODO : Limit this for performance
                     <filter-mapping>
                     <filter-name>Upload Filter</filter-name>
                     <url-pattern>/*</url-pattern>
                     </filter-mapping> -->
                    
                    
                     <filter>
                     <filter-name>ewFilter</filter-name>
                     <filter-class>com.lmig.lit.lpew.filter.EWFilter</filter-class>
                     </filter>
                     <filter-mapping>
                     <filter-name>ewFilter</filter-name>
                     <url-pattern>/*</url-pattern>
                     <dispatcher>REQUEST</dispatcher>
                     <dispatcher>INCLUDE</dispatcher>
                     <dispatcher>FORWARD</dispatcher>
                     <dispatcher>ERROR</dispatcher>
                     </filter-mapping>
                    
                    
                    
                    
                     <!-- Setup a listener to connect spring with log4J -->
                     <listener>
                     <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
                     </listener>
                    
                     <!-- NOTE: ContextLoaderListener may not work for all application -->
                     <!-- servers. If it does not work on WAS, we'll have to use -->
                     <!-- ContextLoaderServlet instead. -->
                     <!-- This listener is to connect spring with the web context -->
                     <listener>
                     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
                     </listener>
                    
                     <!-- Faces Servlet. Standard JSF config -->
                     <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>/faces/*</url-pattern>
                     </servlet-mapping>
                     <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>index.htm</welcome-file>
                     <welcome-file>index.jsp</welcome-file>
                     <welcome-file>default.html</welcome-file>
                     <welcome-file>default.htm</welcome-file>
                     <welcome-file>default.jsp</welcome-file>
                     </welcome-file-list>
                    
                     <error-page>
                     <error-code>500</error-code>
                     <location>/errorPage.jsp</location>
                     </error-page>
                     <error-page>
                     <exception-type>javax.faces.FacesException</exception-type>
                     <location>/errorPage.jsp</location>
                     </error-page>
                     <error-page>
                     <exception-type>javax.servlet.ServletException</exception-type>
                     <location>/errorPage.jsp</location>
                     </error-page>
                     <error-page>
                     <exception-type>java.lang.Exception</exception-type>
                     <location>/errorPage.jsp</location>
                     </error-page>
                    
                    
                    </web-app>
                    


                    • 7. Re: Stylesheet and javascript loading error
                      ilya_shaikovsky

                      RF filter should be defined at first place.

                      • 8. Re: Stylesheet and javascript loading error
                        cordnerg

                        Ilya - I don't understand - can you explain what you mean?

                        • 9. Re: Stylesheet and javascript loading error
                          ilya_shaikovsky

                          you have filters defined in web.xml. RichFaces filter and mapping definitions should be first in chain.