Here is my code.
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();
}
I need to know how to handle ServletException
and IOException
in given code. I wish to redirect user to a error page and tell user to error occurred when getting above exceptions.
How could i do this ?