• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server Exception Declaratively Problem

 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exceptions can be handled declaratively by adding the entry in the web.xml.
Consider the case that we have a entry like:-

<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>/servlet/MyErrorHandlerServlet</location>
</error-page>
In this MyErrorHandlerServlet is used to handle the exception of type SQLException.
Now Suppose we got exception SQLException in the servlet, this will call MyErrorHandlerServlet.
What will happened if SQLExpetion again occurs inside MyErrorHandlerServlet???
Will it call again MyErrorHandlerServlet in infinite loop or what??
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's not reasonable to develop an exception handling servlet and the servlet itself does not handle exception... Then what's the point to develop the MyErrorHandlerServlet.... I guess if it does not handle the SQLException in it, there will be an infinite loop... Just an opinion..
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Naing i know that this should not happen practically, but my idea is just to think and explore....
and who know we can hit the new thing...
Wat do u say my frnds???
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:roll: Yes, you found a new thing... It may be a overlooked weakness of the implementation on Specifications.....
 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes thats what i m trying.,... to improve my thiking process may be...we have got something out of that....
Naing Wat do u say?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic