This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I am trying to handle the exceptions in jsf , i have added the following to the web.xml
Exception handling part of web.xml
in some of the pages of the application am getting something like dataAccessException and it is redirecting to the page called /pages/common/error500.xhtml
i am facing the following 2 problems:
1) during existance of such dataAccessException and after redirecting to the page error500.xhmtl , the contents of page error500.xhtml is not displayed in a proper way that is am getting the title page "ErrorPage" but the contents of the page ( i mean the output label) is not displayed
2) how to display the exception type in this page error500.xhtml (e.getMessage())
Without actually checking, I'll make a strong bet that it's because you're attempting to use JSF on the error pages.
JSF requires a fair amount of context that isn't available when a view request is made by the webapp container, which is what happens when you provide a view URL in the web.xml file. I can definitely state that you can't use JSF on container login pages, for example, although login is a more complex process anyway.
The problem isn't just JSF. Struts, for example, also has the same issues.
I think you can get around this by making the error pages do redirects, but for the most part error pages are better off not doing anything ambitious enough to require JSF anyway. Since these pages all indicate serious errors, the backing bean data isn't 100% guaranteed reliable at that point. For errors in the application logic itself, you're better off catching the exceptions and dispatching them as application error pages instead of letting them fly off to container-land.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Oct 22, 2007
Hi Samuel March , Thanks for your reply , am using jboss application server....
Hi Tim Holloway thanks for your reply , but am still getting the same error.......