JSP自定义500错误页面

1.在可能出错误的页面,声明处理错误的页面

<%@ page  errorPage="/calculator/error.jsp" %>

2.在处理的页面中

<%@ page isErrorPage="true" %>

3.将原因显示

1         <%=    
2                   /* exception.getCause() */
3                   exception.getMessage()//打印错误原因
4        %>

 

posted @ 2013-03-27 22:46  hacket520  阅读(331)  评论(0)    收藏  举报