jsp has implicit exception object if the jsp page is error page
Throwable exception = (Throwable)request.getAttribute("javax.servlet.error.
exception");
if you try to get it in servlet or the page is not error page. this works
only for spec2.3+
Throwable exception = (Throwable) request.getAttribute("javax.servlet.jsp.
jspException");
should be used for 2.3-
j****y 发帖数: 178
3
thank you so much. I am kind of new in java. so what's spec2.3?
Can I get error message or error code just from request?
【在 s******e 的大作中提到】 : jsp has implicit exception object if the jsp page is error page : Throwable exception = (Throwable)request.getAttribute("javax.servlet.error. : exception"); : if you try to get it in servlet or the page is not error page. this works : only for spec2.3+ : Throwable exception = (Throwable) request.getAttribute("javax.servlet.jsp. : jspException"); : should be used for 2.3-