HTTP Status 500 - Cannot call sendRedirect() after the response has been committed
主要是 sendRedirect()执行完之后没有结束,还会继续往下执行,所以sendReirect()后面就不要在sendReirect()了。
if(type.equals("0")){
...
response.sendRedirect("cart.jsp");}else if(type.equals("1")){
...
response.sendRedirect("cart.jsp");}else if(type.equals("2")){...response.sendRedirect("cart.jsp");}else if(type.equals("3")){...response.sendRedirect("success.jsp");}response.sendRedirect("index.jsp");
要么每次sendRedirect之后return 要么再放个else