Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getRootCause()  RSS feed

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"));
I would be very grateful for any comment on this subject,
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!