4 Replies Latest reply on Feb 16, 2009 6:25 AM by dorfbewohner

    Neither styles nor scripts are loaded on error page

      Try to configure an error page in your application - either for the 400 or for the 500 error code. In both cases, when the error page appears, Neither styles nor scripts are loaded and thus, for example, the rich menu buttons dont work - they are rendered just as text, not as clickable links.
      Detected in: Server side: RichFaces 3.3.0, JSF 1.2_07-b03-FCS, facelets 1.1.14, JDK 1.6.0_07, Tomcat 6.0, Win XP SP2; client side: Win XP SP2, Firefox 3.0 and IE 7

        • 1. Re: Neither styles nor scripts are loaded on error page
          nbelaevski

          Hello,

          I've tried and that worked for me. Please post your web.xml.

          • 2. Re: Neither styles nor scripts are loaded on error page

            OK, I will construct a test case webapp and post it here. This will take a while. This is my web.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app id="WebApp_ID" version="2.5"
             xmlns="http://java.sun.com/xml/ns/javaee"
             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_2_5.xsd">
             <display-name>PsoBest1</display-name>
             <context-param>
             <param-name>access</param-name>
             <param-value>/WEB-INF/access.xml</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.REFRESH_PERIOD</param-name>
             <param-value>-1</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>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.jsf</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>facelets.DEVELOPMENT</param-name>
             <param-value>false</param-value>
             </context-param>
             <context-param>
             <param-name>com.sun.faces.externalizeJavaScript</param-name>
             <param-value>true</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-mapping>
             <filter-name>richfaces</filter-name>
             <url-pattern>*.jsf</url-pattern>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
             <listener>
             <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
             </listener>
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>0</load-on-startup>
             </servlet>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</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>
             <exception-type>java.lang.Exception</exception-type>
             <location>/view/techerror500.jsf</location>
             </error-page>
             <error-page>
             <error-code>404</error-code>
             <location>/view/techerror400.jsf</location>
             </error-page>
             <login-config>
             <auth-method>BASIC</auth-method>
             </login-config>
            </web-app>
            


            • 3. Re: Neither styles nor scripts are loaded on error page
              nbelaevski

              Add ERROR dispatcher:

              <dispatcher>REQUEST</dispatcher>
               <dispatcher>FORWARD</dispatcher>
               <dispatcher>INCLUDE</dispatcher>
               <dispatcher>ERROR</dispatcher>
              for this to work.

              • 4. Re: Neither styles nor scripts are loaded on error page

                Thank you! Now it works.