日期:2014-05-18  浏览次数:20836 次

哪位大虾告诉我这个怎么解决啊:Cannot forward after response has been committed
我是个JSP的初学者,今天碰到个问题非常头疼。。页面不能跳转,数据提交到数据库正常,出个这样的错:java.lang.IllegalStateException:   Cannot   forward   after   response   has   been   committed
它的意思好象是不能在响应提交之后跳转。。。怎么都搞不好,望各位高手帮忙出出主义

代码如下:

package   bookshop;
import   javax.servlet.*;
import   javax.servlet.http.*;
import   java.io.*;
import   java.util.*;
import   java.sql.*;
public   class   submitServlet   extends   HttpServlet   {
        private   static   final   String   CONTENT_TYPE   =   "text/html;   charset=GBK ";
        //Initialize   global   variables
        public   void   init()   throws   ServletException   {
        }
        //Process   the   HTTP   Get   request
        public   void   doGet(HttpServletRequest   request,   HttpServletResponse   response)   throws
                        ServletException,   IOException   {                        
        }
        public   void   doPost(HttpServletRequest   request,   HttpServletResponse   response)   throws
                        ServletException,   IOException   {
                doGet(request,   response);
                response.setContentType(CONTENT_TYPE);
                PrintWriter   out   =   response.getWriter();                
                request.setCharacterEncoding( "GBK ");
                response.setCharacterEncoding( "GBK ");
                HttpSession   session1   =   request.getSession(false);
                orderBean   order   =   (orderBean)   session1.getAttribute( "order ");
                String   LoginName   =   (String)   session1.getAttribute( "LoginName ");
                Integer   number1;
                String   pay1   =   request.getParameter( "pay ");
                String   carry1   =   request.getParameter( "carry ");
                String   bz1   =   request.getParameter( "bz ");
                order.setPa