File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling jsf exception

 
anitha meena
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to handle the exceptions in jsf , i have added the following to the web.xml

Exception handling part of web.xml




error500.xhtml




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())


thanking all of you in advance
 
anitha meena
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any reply
 
Samuel March
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) how to display the exception type in this page error500.xhtml (e.getMessage())

That one is quite fatal on the application, generally if you see that , always restart the VM.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17633
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
anitha meena
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.......
 
anitha meena
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any reply or suggestion
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic