setStackTrace(StackTraceElement[] stackTrace)
引數說明:<%@page language="java" pageEncoding="GBK" errorPage="error.jsp"%> <% Integer.parseInt("測試"); %>然後在 error.jsp 頁面設定堆疊跟蹤元素(只是演示用法),關鍵程式碼如下:
<%@page language="java" pageEncoding="GBK" isErrorPage="true"%> <% StackTraceElement[] stackTrace = exception.getStackTrace(); exception.setStackTrace(stackTrace); %>