1 Reply Latest reply on Nov 24, 2010 7:33 AM by Katya Panayotova

    error page doesn't render richfaces

    Katya Panayotova Newbie

      Hi,

       

      I'm using JSF, Spring, Richfaces. I added an error page in my web.xml:

       

       

      <error-page>

      <error-page>

        <exception-type>java.io.IOException</exception-type>

        <exception-type>javax.servlet.ServletException</exception-type>

        <location>/errorPage.faces</location>

      </error-page>

        <exception-type>java.io.IOException</exception-type>
        <exception-type>javax.servlet.ServletException</exception-type>
        <location>/errorPage.faces</location>
      </error-page>

       

      and the errorPage file uses a template that has richfaces components and they are not rendered. I think the problem is that richfaces filter has a mapping for Spring MVC Dispatcher Servlet, and the error page suffix is .faces and the filter doesn't maps it, but if I change the suffix of the error page to .sp (the suffix for Spring MVC Dispatcher Servlet) there is an error in web.xml: error: Attribute location references to /errorPage.sp that does not exist in web content.

       

      I tried to change the filter mapping to Faces Servlet, but it is still not working and the whole application does not have richfaces.

       

      What can I do to use my template and error page?

        • 1. Re: error page doesn't render richfaces
          Katya Panayotova Newbie

          The problem was that the richfaces filter didn't have an error dispatcher:

           

           

          <filter-mapping>
            <filter-name>richfaces</filter-name>
            <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
            <dispatcher>ERROR</dispatcher>
          </filter-mapping>

          <filter-mapping>

            <filter-name>richfaces</filter-name>

            <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>

            <dispatcher>REQUEST</dispatcher>

            <dispatcher>FORWARD</dispatcher>

            <dispatcher>INCLUDE</dispatcher>

            <dispatcher>ERROR</dispatcher>

          </filter-mapping>

           

           

          I also moved the error page file to WEB-INF, and the location of the error page is /errorPage.sp. There is still an error in web.xml, but it is working.

           

          The SecurityContextHolder was null, but when I added the error dispatcher in springSecurityFilterChain it was ok:

           

          <filter-mapping>

            <filter-name>springSecurityFilterChain</filter-name>

            <url-pattern>/*</url-pattern>

            <dispatcher>REQUEST</dispatcher>

            <dispatcher>FORWARD</dispatcher>

            <dispatcher>INCLUDE</dispatcher>

            <dispatcher>ERROR</dispatcher>

          </filter-mapping>