1

I use JSF 2.1.7 Mojarra.

If I write an incorrect URL (a page that doesn't exist) in the address bar of the browser, in order to test that I'm redirected to my custom error page for http error 404, I get instead the following exception (error 500):

com.sun.faces.context.FacesFileNotFoundException

I've found that this is a bug. See the following issue in Jira:

http://java.net/jira/browse/JAVASERVERFACES-1762

And that it has been already fixed (modifying the code of some JSF classes). See:

http://java.net/projects/mojarra/lists/commits/archive/2010-12/message/18

But I haven't found any patch.

Where can I get the patch that fix this bug? Is it possible to get or do I have to override the JSF code myself?

Thank you very much.

choquero70
  • 4,470
  • 2
  • 28
  • 48

1 Answers1

3

I suppose JSF is trying to be independent of Servlets/HTTP with this exception. I just catch it in a filter:

        try {
            chain.doFilter(request, response);
        } catch (FacesFileNotFoundException e) {
            response.sendError(404, e.getMessage());
        }
Roger Keays
  • 3,117
  • 1
  • 31
  • 23