The bug lies here:
I forward a request in my servlet.
After I commit the output, I perform the forwarding.
Tomcat doesn't act conforming to the servlet 2.2 specification,
which specifies that it should throw the IllegalStateException.
Peek the source:
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException {
response.setContentType("text/html;charset=gb2312");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Forward A Request</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Just A Test!</h1>");
out.println("</body>");
out.println("</html>");
out.flush();
request.getRequestDispatcher("/forwarded.jsp").forward(request,response);
}
----------
通信地址:南京市汉中路180号星汉大厦11楼<210029>
电 话:025-6799480-308
POSTADDR:11F XINGHAN BUILDING 180 HANZHONG ROAD NAN JING CHINA
ZIPCODE:210029
TEL:86-25-6799480-308
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]