• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to handle exception in JSF2.0?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to all,
I am try to use new feature of exception handling in JSF2.0. Requirement is to show the stack trace on the error pageusing JSF2.0 exception Handling feature, if any unhandled exception occur . Problem is that, when exception is occurring , error page is displayed but it is not displaying the error info that I am trying to display. I think I am not able to use the proper EL to retrieve the value. Please suggest.....

Below are the codes:

faces-config.xml


ExceptionHandlerFactory


Custom ExceptionHandler



web.xml


error.xhtml


code process fine, excetionFactory and customExceptionHandler also does well and when any exception occurs error page is also displayed. but the problem is that - only static messages are being displayed, its not displaying the value from EL. One other problem is that when I am making any change in error.xhtml then I need to run it explicitly to make it compile and then only its reflecting the changes when actual application throws any exception and it navigates to the error page.

I am very new to JSF, and I am finding it difficult to get the solution. It would be a great help, if anybody can suggest some solution.

Thanks in advance,
Amrit Pandey
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that you assume there is a connection between exception and faces messages. There is not. So you have to manually extract message from exceptions and push them into faces messages.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
remove the redirect true i.e ( navigationHandler.handleNavigation(facesContext,null, "/error"); )

Regards
Wish79
 
You can't expect to wield supreme executive power just because
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic