Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Showing Exception Message in client side

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually in my servlet i am reading devices from a file.
But when FileNotFoundException occurs i need to see that exception in the jsp page.
how can i show the exception message in jsp?
could any body suggest?



Regards,
Rama
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can map an error handling page in the deployment descriptor.

But be aware that showing exceptions to uses is generally considered a bad practice. Rather, it is more customary to log the exceptions for the developers, and to show the users a more generic "sorry, but something went wrong" message.
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bear suggested, you can configure errors and exceptions in web.xml. Please see the link
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic