【发布时间】:2014-09-01 14:51:47
【问题描述】:
这是我的代码。
try {
RequestDispatcher d = request
.getRequestDispatcher("messages/error.jsp");
request.setAttribute("message", "Error Occurred !!!");
d.forward(request, response);
} catch (ServletException se) {
se.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
}
我需要知道如何处理给定代码中的ServletException 和IOException。我希望将用户重定向到错误页面并告诉用户在遇到上述异常时发生错误。
我该怎么做?
【问题讨论】:
标签: jsp jakarta-ee servlets