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.
SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287