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

getRootCause()

 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
Did you try the code snippet of SCWCD Exam Study Kit p.103,
This is about handling exceptions declaratively :
in the servlet that throws wrapped SQLException:

Now the authors say we can retrieve the detailed exception message by using the javax.servlet.error.exception attribute like this:

I've tested this and it isn't the case, because exception is instance of SQLException and not ServletException so we never go inside the if block.
Furthemore, the authors say that the this atribute javax.servlet.error.exception makes the attribute javax.servlet.error.message redundant but - at least in French -, i don't obtain the same result with thiese two methods:
1�)pw.println("<br>message: "+req.getAttribute("javax.servlet.error.message"));
2�)
I would be very grateful for any comment on this subject,
Regards,
Cyril.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic