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

servlet query

 
Naresh Shaan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whn can servlet exception be raised.....
wat causes the servlet to generate servletexception
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Naresh",
Please read Bear's request from your previous post more closely.

Display names must be two words: your first name, a space, then your last name.

Also, please try to use real words. I suspect your last question wasn't answered because your question was hard to read.

thanks,
Dave.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the Javadocs:
Defines a general exception a servlet can throw when it encounters difficulty.

Basically there are any number of things that can go wrong, not just in the servlet but in any of the other classes in the servlet container. If you look closely at the exception, it is designed to contain other exceptions, so this exception is just a way of remembering other exceptions but also (I suspect) a way to indicate that the exception has been 'managed' by the container.

You could also throw servlet exceptions yourself if you didn't want to handle an exception yourself (such as an SQLException) but it would be better to handle this yourself rather than leaving it to the container.

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic