Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Showing Exception Message in client side  RSS feed

 
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
Posts: 65828
134
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: 548
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!