Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is ServletException an unchecked Exception

 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all
i want to ask Is ServletException an unchecked Exception?
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
definatly Yes. We are never going to handle it in our code. R we? Container may have some way to handle it but thats out of our scope.
Please correct me if anything wrong here.
 
John Pearson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, ServletException is a checked exception. Any Exception that's not a RuntimeException is checked, so the compiler will check it and be upset if you don't either handle it or declare that the method throws it.
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tht right, Its checkedException.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When in doubt, check the API to see if the exception extends RuntimeException.

All RuntimeExceptions are unchecked.
 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks to you all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic