This is the code in doPost:
try {
switch (request.getParameter("action")){
case "delete":
request.setAttribute("message", "Deleting...");
break;
case "update":
request.setAttribute("message", "Updating...");
break;
case "new":
response.sendRedirect("createNew.jsp");
break;
default:
super.doPost(request, response);
break;
}
} finally {
request.getRequestDispatcher("backHome.jsp").forward(request, response);
out.close();
}
The problem is in the finally I'm getting this exception when the case is 'new': java.lang.IllegalStateException: