java.lang.IllegalStateException: Cannot forward after response has been committedjava
網上都說什麼加一個return 有用全是放屁jsp
是你的dopost方法裏面因爲response屢次提交或者是因爲有頁面顯示後仍然含請求轉向產生的,ide
就是說程序在return以前就已經執行了跳轉或者執行過response,以後遇到return的話,程序想再次執行跳轉,也就是重定向,post
其實是spa
@Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.doPost(request, response);
request.getRequestDispatcher("message.jsp").forward(request, response);
裏的super.dopost 和 forward 有衝突blog
super裏重定向一次, forward重定向一次 形成了 兩個跳轉get
因此產生了java.lang.IllegalStateException: Cannot forward after response has been committedit