Code: Select all
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
try{
throw new IOException();
}
catch (IOException e){
request.getRequestDispatcher("errorPage.jsp").forward(request, response);
}
}
}