Action调用Service,Service抛出异常,Action可以捕获到,但我现在不想捕获,想直接把异常输出到页面中去。
我定义了errorPage.jsp,并且isErrorPage="true"。
errorPage.jsp代码如下
Exception e = null;if(exception != null) {
e = (Exception)exception;} else if(request.getAttribute("exception") != null) {
e = (Exception)request.getAttribute("exception");

} else if(request.getAttribute("javax.servlet.error.exception") != null) {
e = (Exception)request.getAttribute("javax.servlet.error.exception");

} else if(request.getAttribute("javax.servlet.jsp.jspException") != null) {
e = (Exception)request.getAttribute("javax.servlet.jsp.jspException");

}可到最后e=null,异常信息怎么也出不来,请问大家帮忙看看,谢谢了~~